Closed topherfangio closed 1 month ago
@topherfangio welcome to the world of trying to generate markdown documentation! It's a bit painful, but i'll try to give you as much support as possible here ;-)
Yard does have markdown
support build in, but that's only for markup in your source code. Hence tweaking --markup=***
parameter doesn't really help here at all to produce markdown documentation.
No such template for default/layout/markdown
error that you are seeing could mean two things.
yard-markdown
gem installed.
This is easy to check, with a following bash code gem list | grep yard
.For me, the stable way to ensure that yard-markdown is always loaded is to define ~/.yard/config
with the following contents:
!!!yaml
load_plugins: true
autoload_plugins:
- markdown
I'm building an automated script, that tries to build markdown documentation from bunch of gems and this works 100% for me.
In your case, you might want to drop yard- from plugin name in .yardopts. e.g.
--debug
--output-dir docs/yard/generated
--plugin markdown
--format markdown
Hopefully this answers your question. I'm closing this issue. You are welcome to suggest re-opening, if you feel that I can improve yard-markdown gem (maybe docs?)
Hello, I'm very interested in getting yard-markdown working in my Ruby gem. I'm using a Docker setup and
yard server --reload
to watch for changes so that I can simply refresh the page.I didn't realize Yard now supported Markdown out of the box using
--markup markdown
, but it doesn't seem to be as nice as what I'm hoping yard-markdown can do. In particular, I'm thinking about code blocks for examples and such.However, I can't seem to get it working with
.yardopts
.First Attempt
With this approach, it seems to load the plugin just fine (there are no errors about it not being able to find it like if I do
--plugin doesnotexist
). However, I get the following error:Second Attempt
If I use
--markup markdown
, it appears to bypass it and use the built-in Markdown generator.Third Attempt
If I add
--markup-provider yard-markdown
, I get the following error which I assume means your plugin doesn't define a custom markup provider:Question
Am I missing something? Does it only work if you use the
~/.yard/config
file?Thanks!