Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav (Stas) Katkov authored and skatkov committed Dec 28, 2024
1 parent 37adc29 commit 4d71ebf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion .yardopts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
--load ./lib/yard-markdown.rb
--format markdown
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Yard::Markdown

Yard plugin to generate markdown documentation
Yard plugin to output markdown documentation.

## Motivation
Markdown has become the de-facto documentation standard. I heavily rely on Obsidian to render my storage of markdown notes. But markdown is used not just for scribbles, supported is far and wide. We can render markdown file on any device, probably even on thermometer with a screen. But also everyone knows enough markdown to be dangerous (or productive).
It's a pitty that rdoc and yard can't output a proper markdown file. I would like to change that.

## Goals:
- Compatible with Github Flavored Markdown
- Produce .csv index file
- Mimick yard html layout where it makes sense to maintain familiarity
- Produce .csv index file alonside markdown documentation to act as file index

## Usage
Yard doesn't load plugin by default, so you need to load plugin through `~/.yard/config`:
Expand All @@ -24,8 +28,19 @@ gem install yard-markdown

Run `yardoc --format=markdown` to generate markdown documentation.

## Backstory
This is a successor to [rdoc-mardown gem](https://github.com/skatkov/rdoc-markdown/tree/main/example). These docsets are used in [POSH TUI](https://poshtui.com).
## Note on RDoc support
It seems important to note, that yard claims to have support for RDoc. That support is certainly present, but output for rdoc is dramatically different. A lot of useful information seems lost in the process.

If you know how to improve that, please get in touch or submit a patch.

So in meantime, there is work going on a competing gem for RDoc and it's called [rdoc-mardown gem](https://github.com/skatkov/rdoc-markdown/tree/main/example).

## Note on index.csv file
This gem emits index of all markdown files in a index.csv file.

There are decent tools that offer search through structured plain-text files. But my expectation is that nobody will use CSV as an actual search index, but rather import it into something that performs this function better.

In my personal use-case, I use SQLite. All other databases seem to have a good support for CSV imports.

## Testing
Unit tests can't really test this gem properly. So it's semi-manual process of making changes and reviewing output.
Expand Down
5 changes: 0 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,4 @@ namespace :examples do
task :rdoc do
sh "yardoc --output-dir example/rdoc example_rdoc.rb"
end

desc "Generate example documentation for code annotated with ruby source code"
task :ruby do
sh "yardoc source_ruby --output-dir example/ruby"
end
end
1 change: 0 additions & 1 deletion source_ruby
Submodule source_ruby deleted from f226bc

0 comments on commit 4d71ebf

Please sign in to comment.