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

refactor: Use Markdown tables for rendering cheat sheets #66

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

sevenseacat
Copy link
Contributor

Also uses regular Markdown files for cheat sheets instead of .cheatmd files.

All functionality like required stars and links to each individual option/argument is retained, using Markdown shenanigans (that doesn't seem to be documented anywhere but works? Saw it on Stack Overflow)

Benefits:

  • ex_doc can autolink content within tables (links to other pages or modules, see screenshots)
  • More consistency with other hex documentation

Screenshots of a tiny part of the Resource DSL docs:

Before After
Screenshot 2023-11-14 at 2 16 05 pm Screenshot 2023-11-14 at 2 16 15 pm

(note: table borders in the "After" screenshot are still in an ex_doc PR)

These are styled differently by ex_doc, but are also more appropriate
for the types of content we're generating
…ions and arguments

This allows ex_doc to parse the content and add links to other pages
and modules
@zachdaniel
Copy link
Contributor

Very nice :) now I need to decide if I want to update spark for all projects and regen docs or not 😂 could also just let them update when they update.

@sevenseacat
Copy link
Contributor Author

sevenseacat commented Nov 15, 2023

Let them update when they update, IMO.

There is one small issue - because the generated cheat sheets have changed their format, the first time docs are generated for a project, it will raise an error. This is because the list of files for extra_documentation is compiled once at the start of the docs alias, and then the file names change out from underneath it before ex_doc can do it's thing.

Subsequent runs work, so I'm not sure if its worth spending too much time on.

@zachdaniel
Copy link
Contributor

Yeah, I think I can live with that :)

@zachdaniel zachdaniel merged commit c238974 into ash-project:main Nov 15, 2023
4 checks passed
@sevenseacat sevenseacat deleted the refactor/cheat-sheet-tables branch November 15, 2023 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants