Skip to content

Docgen#257

Open
dweng0 wants to merge 37 commits intomasterfrom
docgen
Open

Docgen#257
dweng0 wants to merge 37 commits intomasterfrom
docgen

Conversation

@dweng0
Copy link
Copy Markdown
Collaborator

@dweng0 dweng0 commented Nov 6, 2024

This PR adds the following functionality:

  • Auto-generated documentation (must run script to generate the documentation).
  • Implements a feature toggle to show or hide content, CSS files, and CSS classes.
  • Introduced additional Lua scripts to enhance the auto-generated documentation.

Summary of changes

  • moved the scss files to css files as they do not compile properly otherwise.
  • contract.py fixes and issue with description being included even if its not available.
  • _features.yml is essentially a config file to list files and or classes that should be excluded when compiled.
  • The new filters are all designed to provide a better UI experience, for example the access type of a function, or additional details at the foot of the contract's page
  • The feature-filter.py script executes post quarto render and removes css files classes based on a list of files and classes provided in the _features.yml file.

@dweng0 dweng0 requested a review from aiman as a code owner November 6, 2024 10:51
@dweng0 dweng0 marked this pull request as draft November 6, 2024 10:51
@dweng0 dweng0 marked this pull request as ready for review November 6, 2024 11:18
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script executes post quarto render and removes css files classes based on a list of files and classes provided in the _features.yml file.

@aiman
Copy link
Copy Markdown
Collaborator

aiman commented Nov 15, 2024

@dweng0

This is a good start, however the branch is using an old commit of master, before the README changes went in, which is not conducive to code review.

Please rebase the branch off the current master, make any necessary changes such as in the README, and then force-push the branch up to Github.

Also, please fix the whitespace errors introduced in this PR. There are already a lot in the repo, but that doesn't mean we should add to the problem!

Check whitespace errors in this PR:

git fetch origin
git checkout docgen
git diff --check origin/master...HEAD

Good resource: Checking whitespace with Git

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 18, 2024

🚀 This branch can be previewed at https://59ae9cbc.docs-autonity-org.pages.dev

dweng0 and others added 20 commits December 6, 2024 13:58
* update the gh_pages workflow

* update workflow to include working directory

* update workflow

* update readme

* update readme, remove unused wiki link
…229)

* update quarto yml file and add mock contracts for testing

* add filters

* add footer links

* update theme
* make the 4 byte text less prominent

* update quarto and lua script

* update styling where applicable

* add example markdown
…tom of the document (#236)

* update footer lua script to allow for versioning

* remove "version" text from the lua script

* update css for version text and add example

* Update styling and add missing chevrons

* update example to include "next" for better visualisation of version placement

* update css to make prev-next buttons smaller

* update location for where contract docs will go (references/api/)

* add fixes to styling for when only one navigation button is available

* removed example contracts

* removed 'latest' default for version string when no version is provided

* Update quarto version in PR action

* update versions
* Add contract description to metadata and not to page content in API docs

To ensure that the auto-generated index.md doesn't contain unrelated
data, as described in #244.

* Disable word break in listing description

With `word-break: break-all` the description would look something like:

    A CDP-based stabilization mechanism f
    or the Auton.

    Controls the supply of Auton on the net
    work.

which is not great for readability.
* Update the ui for the auto generated solidity contract documentation (#229)

* update quarto yml file and add mock contracts for testing

* add filters

* add footer links

* update theme

* Update UI templates and scripts to show the version number at the bottom of the document (#236)

* update footer lua script to allow for versioning

* remove "version" text from the lua script

* update css for version text and add example

* Update styling and add missing chevrons

* update example to include "next" for better visualisation of version placement

* update css to make prev-next buttons smaller

* update location for where contract docs will go (references/api/)

* add fixes to styling for when only one navigation button is available

* removed example contracts

* removed 'latest' default for version string when no version is provided

* Update quarto version in PR action

* update versions

* update theme so that content margins can be adjusted

* increase top margins for better grouping
* add a basic feature toggle

* add empty script

* add feature flag wip

* Update readme, remove testing code from index.md
@dweng0
Copy link
Copy Markdown
Collaborator Author

dweng0 commented Dec 10, 2024

Change delta following rebase

The following reverts the GHA workflow and README changes to master branch:


The following fixes whitespace issues in the GHA workflows and index.md and /api.index.md

Updated wording to say "css" instead of "scss"
@dweng0
Copy link
Copy Markdown
Collaborator Author

dweng0 commented Dec 17, 2024

In this ee3fc51 commit i changed a comment in the code to say "css" instead of "scss" to prevent any confusion when used in future.

Autonity has been building natspec docs since the 1.0 release.
@szemate
Copy link
Copy Markdown
Contributor

szemate commented Feb 11, 2025

@aiman I've made the following changes to streamline the build process:

  1. Install solc from the Nix store and use it to build the contract ABIs and NatSpec data files before the documents are generated. (e6e0f48)
    • It's a lot faster (~0.5 sec vs. ~20 sec for make contracts)
    • We can be sure that the generated files are in sync with the Autonity source code
    • We don't have to deal with the idiosyncrasies of the Autonity build process
  2. Add site-preview and site-render commands (in line with the dashboard repository) that run apidocgen and quarto together if a symlink to Autonity is in the directory. (4c7739f)
    • Unfortunately it isn't possible to use Quarto's pre-render hook because it runs after input files are collected and apidocgen may change the input files.

Let me know what you think.

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.

3 participants