Filter for linking Agda identifiers in inline code spans
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

2 years ago
2 years ago
  1. # agda-reference-filter
  2. A Pandoc filter for linking Agda identifiers in inline code blocks.
  3. ## Usage
  4. The filter operates on Markdown files generated by Agda's built-in
  5. literate programming support (use `--html-highlight=auto` to keep the
  6. Markdown), then call Pandoc with the filter:
  7. ```bash
  8. agda --html-highlight=auto --html example.lagda.md
  9. pandoc --filter agda-reference-filter -i example.md -o example.html
  10. ```
  11. The input file will be scanned, in source order, to build a variable
  12. name - HTML element association.
  13. Only the first reference is counted: if you have two identifiers called
  14. `go`, then `` `go` `` in Markdown will link to the first.
  15. ### Controlling whether spans are linked
  16. Code spans in Markdown are only linked if they have the `agda` - **case
  17. insensitive** - class. In Pandoc syntax, you can attach a class to a
  18. code span like so:
  19. ```
  20. `List`{.agda}
  21. ```
  22. If you want a span to have the `agda` class but for it not to be linked,
  23. add the `nolink` class.
  24. ### Controlling what spans are linked to
  25. If a span has the `ident` attribute, then the value of that attribute
  26. will be used as the identifier to link to instead of the span text.