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

Support admonitions in Markdown docs #95

Closed
bbatsov opened this issue Aug 13, 2018 · 11 comments
Closed

Support admonitions in Markdown docs #95

bbatsov opened this issue Aug 13, 2018 · 11 comments
Labels
Good First Issue Want to help ship cljdoc? These are good issues to start with. Guides Issues related to rendering guides or articles originating from Markdown or similar formats. Help Wanted

Comments

@bbatsov
Copy link
Contributor

bbatsov commented Aug 13, 2018

I typically publish my project's docs using MkDocs () and I'm always making use of https://github.com/Python-Markdown/markdown/blob/master/docs/extensions/admonition.md

Seems that's not currently supported by whatever Markdown processor cljdoc uses, which is quite unfortunate for me.

Take a look here https://cljdoc.xyz/d/nrepl/nrepl/0.4.4/doc/middlewares and you'll immediately understand my problem.

@martinklepsch
Copy link
Member

martinklepsch commented Aug 14, 2018

It seems this would be fixable by switching to flexmark-java (based on commonmark-java which we are using currently).

That said admonitions are fairly non-standard Markdown features (i.e. not part of CommonMark or GFM) so maybe in this case it would be better to just use a markup language that supports this (e.g. Asciidoc)?

By doing so you'd also get better rendering support on GitHub as your admonitions aren't rendered correctly there either.

You can mix and match Asciidoc and Markdown with cljdoc as you like, as long as references to other pages are basic links they will be rewritten work properly. (Here's an admonition example from the yada docs.)

@bbatsov
Copy link
Contributor Author

bbatsov commented Aug 14, 2018

Yeah, I understand other doc formats might be more flexible, but I had written a lot of Markdown in the past and I'm not exactly excited to have to convert all of it to something else. :-)

By doing so you'd also get better rendering support on GitHub as your admonitions aren't rendered correctly there either.

Generally the doc folders in my projects are supposed to be consumed like this nrepl.readthedocs.org.

Anyways, that's not a big deal, and I can think about trying to convert everything to rst or something like this with pandoc. Maybe the conversion will work better than I expect.

@martinklepsch
Copy link
Member

Yeah, I understand other doc formats might be more flexible, but I had written a lot of Markdown in the past and I'm not exactly excited to have to convert all of it to something else. :-)

I totally understand and as I said, we could support this. Contributions certainly welcome but I'm not sure how fast I'll get to it myself.

convert everything to rst or something

.rst is not currently supported (only Markdown & Asciidoc are) but would be great to add that as well.

@martinklepsch martinklepsch added Guides Issues related to rendering guides or articles originating from Markdown or similar formats. Help Wanted Good First Issue Want to help ship cljdoc? These are good issues to start with. labels Aug 14, 2018
@bbatsov
Copy link
Contributor Author

bbatsov commented Aug 14, 2018

Good to know. rST has the advantage that it's the default format for Sphinx and by association ReadTheDocs.

I'd love to tackle this myself, but looking at my own backlog I just get depressed. 🤣

@martinklepsch
Copy link
Member

martinklepsch commented Sep 4, 2018

@bbatsov I looked into Flexmark's admonition support earlier and I think I'd like to avoid getting into this kind of stuff. Icons were not included as described in the documentation, it comes with some 250 lines of CSS and even some JS.

As mentioned before I think in this case it's best to rely on tools that support the desired formatting by default. So would you be open to someone porting the files using admonitions to Asciidoc? While Asciidoc admonitions aren't rendered perfectly yet (#77) I'd feel much better improving that than dealing with somewhat uncommon Markdown extensions.

Here's a list of all files using admonitions:

It's not that many actually — and Asciidoc and Markdown can be used interchangeably on cljdoc so there's no need to port all of them.

@bbatsov
Copy link
Contributor Author

bbatsov commented Sep 4, 2018

I'll think about this. I'm just super busy and changing doc formats is not something I'm willing to spend my time on. I'd still like to publish the manual on nrepl.org as well, but with asciidoc I'll have to look into some different toolchain for gh-pages I presume.

Anyways, feel free to close this ticket.

@martinklepsch
Copy link
Member

Maybe @SevereOverfl0w would be interested in helping with this, knowing his appreciation for Asciidoc 🙂

@SevereOverfl0w
Copy link
Member

If you don't mind adopting the asciidoctor style (e.g. https://juxt.pro/yada/manual/index.html) then publishing to your own site is as simple as running the asciidoctor cli against your project.

Moving between markdown and asciidoctor isn't too bad, especially as asciidoctor has some support for markdown. I might be convinced to spend an afternoon transferring the docs to asciidoc, if there was a solution you were happy with for nrepl.org.

@bbatsov
Copy link
Contributor Author

bbatsov commented Sep 6, 2018 via email

@martinklepsch
Copy link
Member

martinklepsch commented Oct 30, 2018

With cider nREPL having moved from markdown to asciidoc I will close this issue for now.

@bbatsov
Copy link
Contributor Author

bbatsov commented Oct 30, 2018

nREPL ;-)

P.S. You made an AsciiDoc believer out of me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Want to help ship cljdoc? These are good issues to start with. Guides Issues related to rendering guides or articles originating from Markdown or similar formats. Help Wanted
Projects
None yet
Development

No branches or pull requests

3 participants