GithubHelp home page GithubHelp logo

commondoc / codex Goto Github PK

View Code? Open in Web Editor NEW
90.0 90.0 13.0 1005 KB

Build beautiful documentation

Home Page: http://commondoc.github.io/codex/

Common Lisp 64.50% HTML 3.98% JavaScript 20.35% CSS 11.17%

codex's People

Contributors

euandreh avatar eudoxia0 avatar frejanordsiek avatar puercopop avatar rudolph-miller avatar shamazmazum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codex's Issues

Emitting Markdown: what are the options?

I've spent the last few days looking for a documentation system to pull docstrings, convert them and emit markdown. I need a relatively rich input format and RST or Scriba look like they'll do the trick. I've got some legacy Scriba to work with too, and don't fancy converting it. Generally I like the concept of CommonDoc and I think good documentation needs to be a combination of hand-crafted and generated.

With this issue I'd like to explore what the best way to add a markdown package to emit docs/sections as markdown. In theory this should be simpler than the current HTML, since there's no formatting directives or style that need to be handled. The use case is to emit MD to be further processed by a documentation system generator, in this case Hugo. There are many styles ('themes') available, and this way I don't have to concern myself with styling and deployment.

How would one of you experienced with CommonDoc approach this? Initially I thought of:

  1. Cloning the HTML emitter code paths however, to my eye, they're a bit convoluted and involve many systems and dependencies.
  2. Walk the doc tree and use a generic template system like cl-template or html-template to emit the markdown. Despite the name, html-template is actually agnostic to the output format.
  3. Maybe just walk the tree and manually emit?

I think any of these would work; the sticking point at the moment is the conversion of the docstring text from scriba to markdown, which I think happens in a combination of common-html and pandocl.

Any ideas?

"@ref" does not link where it is supposed to

So far as I can tell from the reference, @ref[id=<something>] Is supposed to link to the thing identifed as @<something>[ref=<something>], but it links to a file named <something>, as well as setting the generated link's id to that something.

Method with qualifiers

Could you tell me how insert the documentation for the method that uses qualifiers.
For example for method m-foo with qualifier :after
(defmethod m-foo :after ((x <a>) (y <b>) z) "Documentation for defmethod m-foo :after (x <a>) (y <b>) (z <c>)" t)

generation fails if docstring is nil.

Currently generation fails if the docstring for something, in particular a slot or method is nil.

This is a little annoying for methods that I want to include in the documentation but don't really need a docstring (the docstring for the generic function and the type of the lambda lists should be sufficient), or when documenting a class with private slots.

Documentation for functions aren't inserted during the build on GitHub Actions

I've created an example project https://cl-doc-systems.github.io/codex/ to demonstrate how Codex works. But the section where I use this code:

@cl:with-package[name="example/app"](
  @cl:doc(function foo)
)

instead of documentation on example/app:foo function Codex renders:

Screenshot 2020-12-03 at 20 07 13

Expected Result

When I build the documentation locally, everything is OK:

Screenshot 2020-12-03 at 20 08 18

Debug Information

Here is what I see in logs when building docs in GitHub Actions:

STYLE-WARNING:
   slot names with the same SYMBOL-NAME but different SYMBOL-PACKAGE (possible
   package problem) for class #<STANDARD-CLASS CODEX.MACRO:WITH-PACKAGE>:
       (COMMON-DOC.MACRO:NAME CODEX.MACRO::NAME)
STYLE-WARNING:
   slot names with the same SYMBOL-NAME but different SYMBOL-PACKAGE (possible
   package problem) for class #<STANDARD-CLASS CODEX.MACRO:WITH-PACKAGE>:
       (COMMON-DOC.MACRO:NAME CODEX.MACRO::NAME)
Inserting documentation for function "foo".
Inserting documentation for function "do-the-job".

and the same log it outputs locally.

Full sources are available here: https://github.com/cl-doc-systems/codex

The Question

How to debug what is happening to these blocks?

LaTeX output

Requires some kind of LaTeX emitter library first.

No way to include doc for setf function or method

As far as I can tell there isn't any way to include documentation for a setf function, generic function, etc. I am happy to make a pull request for this if someone can point me in the right direction to fix it.

Automatic visiting of docstrings without manual.scr

What would it take to make Codex parse the docstrings of function, classes, slots, etc. and include the documentation when it find a certain starting token in there.

I'd like to get rid of the manual definitions in manual.scr because I think it is a duplication and redundant. Usually you are in the source codes and write the docstrings anyway.

Mutating docstrings

Common Lisp has a documentation method.
Suppose that the strings of documentation are generated differently,
for example for different localizations.

In my opinion the best behavior of codex would be to extract
docstrings using the documentation method rather than parsing
the source form.

(defun func (a b &optional (c "") (l 1))
    "docstring"
    (declare (ignore a b c l))
  t)

(setf (documentation #'func 'function) "NEW DOCSTRING")
CODEX::FUNC
  [symbol]

FUNC names a compiled function:
  Lambda-list: (A B &OPTIONAL (C "") (L 1))
  Derived type: (FUNCTION (T T &OPTIONAL T T)
                 (VALUES (MEMBER T) &OPTIONAL))
  Documentation:
    NEW DOCSTRING
  Source form:
    (LAMBDA (A B &OPTIONAL (C "") (L 1))
      "docstring"
      (DECLARE (IGNORE A B C L))
      (BLOCK FUNC T))

Allow Markdown as a :docstring-markup-format

Although scribe is fine and easy to learn, many people use markdown these days, and it has the advantage of being more human readable for people browsing the source code directly.

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.