#Rustdoc utils! syntax highlight non-rust code, tags, copy/paste docs

1 messages · Page 1 of 1 (latest)

fathom horizon
#

Currently working on a cool crate that modifies documentation generated by rustdoc some features use inline JS while others use some rustdoc tricks that I found while working on other projects.

https://github.com/michaelni678/doctored

The screenshots attached demonstrate:

top-left) Syntax highlighting for non-Rust languages (using highlight.js). Theme is in the style of rustdoc.
top-right) A tag that appears under items. This can be used to categorize stuff. For example, a "Component" tag for an ECS. optional hyperlink. Unfortunately I couldn't get intradoc links to work. this idea was totally not stolen from Bevy
bottom-left) copy and paste documentation. This can be useful for doctests that have repeating boilerplate code, since you can have a single source of truth if you ever decide to modify that doctest.
bottom-right) similar to the rustdoc ignore attribute, but no "this example is not tested" tooltip appears.

theres a couple more but these are the coolest ones

The crate is mostly ready to publish, it's just that
a) there are no tests, since I dont think theres a framework out for testing doc generation. and im not writing one lol
b) on vacation for the first half of november, so i dont want to publish in case something breaks
c) i have a couple of other ideas but not sure if should just add them in v0.2.0

but yea i think its a pretty cool project, please give it a star on github if you think so too. i like stars

GitHub

Rust documentation utilities. Contribute to michaelni678/doctored development by creating an account on GitHub.

#

Rustdoc utils! syntax highlight non-rust code, tags, copy/paste docs