Code Monkey home page Code Monkey logo

nyandoc's Introduction

Nyandoc: scaladoc/javadoc HTML parser / document generator

日本語の解説を書きました

tl;dr

  • This software can convert javadoc/scaladoc html to markdown format.
  • Text-editor friendly!
  • Under development, but basically works.

Pre-build documents

About

Goal: To parse javadoc/scaladoc HTML and generate the document with specific format.

Motivation: I need Scala API documentation with more text-editor friendly format than HTML. But Scaladoc only support to generate HTML. "doclet" feature is provided, but it is very restricted and difficult to understand. So I don't generate document from sources directly, but instead parse HTML and transform it.

Current status

  • Basic features are supported
    • Parse scaladoc to internal representation
    • Parse javadoc to internal representation
    • Generate markdown documents from internal representation
  • Not supported yet
    • Other output format
    • Old-format(Java 1.6 or older) javadoc html
    • Some html tags (ol, blockquote, table, image)
    • Text layout engine is not support for fullwidth characters.

Install

The project is packaged with Conscript.

Install conscript first, and

$ cs install todesking/nyandoc

Usage

Currently, output format fixed to markdown.

$ nyandoc <source-location> <dest-dir>

or

$ sbt 'run <source-location> <dest-dir>

source-location could be directory, html, jar, or zip. File type is determined by its extension.

Links

Example usage: Use ctags to generate tags file

Add ~/.ctags to this:

--langdef=markdown-scala-nyandoc
--regex-markdown-scala-nyandoc=/^#+ .*(def|val|var|type)[[:space:]]+([^ (\[]+)/\2/

--langdef=markdown-java-nyandoc
--regex-markdown-java-nyandoc=/^#+ .*[[:space:]]([a-zA-Z0-9]+(<.+>)?)\(/\1/

and

ctags --langmap=markdown-scala-nyandoc:.md -R . # For Scala project
ctags --langmap=markdown-java-nyandoc:.md -R .  # For Java project

in nyandoc document directory.

Example usage: Use Vim as document browser

I used these technologies:

At first,

:Unite file:.nyandoc/ -default-action=rec

select-document-type

and select scala-2.11.2

select-document

and select immutable/Seq.md

view-document

and

:Unite outline

view-document-outline

nyandoc's People

Contributors

todesking avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.