Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RST doc strings? #36

Open
snunez1 opened this issue Aug 22, 2023 · 4 comments
Open

RST doc strings? #36

snunez1 opened this issue Aug 22, 2023 · 4 comments

Comments

@snunez1
Copy link

snunez1 commented Aug 22, 2023

I like what you're doing here. A well thought out doc system is desperately needed in the CL ecosystem, rather than the dozen half-baked ones we have now.

As far as mark-up format, RST seems a richer choice than MD. Are there plans to implement MD and a Sphinx converter or domain? I'm aware of cl-domain, however its license isn't compatible with commercial use and anything GNU isn't an option for our projects.

@svetlyak40wt
Copy link
Member

svetlyak40wt commented Aug 22, 2023

This can be done in case if you will implement something like https://40ants.com/commondoc-markdown/ but for converting reStructured Text to CommonDoc structures. CommonDoc is extensible and you can create new node types if you need.

However, for docstrings I don't see a reason to use more complex markup than markdown. All I need from reStructured Text and Sphinx for docstrings is automatic cross-links. But they are already working and with no additional syntax – you just mention a symbol in uppercase.

Probably some other rst features might be useful for longer documents, for example tables. And here at least two ways to implement them. You either have to write a rst -> commondoc converter, nor create special lisp syntax, to include new blocks in defsection body. For example, tables could look like this:

(defsection @readme (:title "Readme")
   "# Here is a description

    Some other text"

    (table :title "The demo numbers"
       (:header "Head 1" "Head 2" "Head 3")
       (:row 100 200 300))

   "And here we have subsequent paragraph of text continuing after the table.")

The latter approach is more flexible and you don't limited by reStructured Text's syntax. However, it will work only for block elements, not for inline.

@svetlyak40wt
Copy link
Member

By the way, on what kind of projects are you working on?

@Symbolics
Copy link

This can be done in case if you will implement something like https://40ants.com/commondoc-markdown/ but for converting reStructured Text to CommonDoc structures. CommonDoc is extensible and you can create new node types if you need.

Ah, so you're using CommonDoc. I always thought Fernando Borretti was on the right track with codex. A shame that development stalled. He had the right idea, but it never seems to have gone beyond proof-of-concept.

Does your use of CommonDoc mean we can use the Scriba syntax for formatting doc strings?

@svetlyak40wt
Copy link
Member

Common Doc is used internally to represent documentation nodes. So it should be more easy to add a Scriba syntax support. Right now I have no time and motivation to work on this myself.

However, if you would like to add this feature yourself, I'll show places there this can be hooked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants