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

Add basic support for tagging text in the spec #1769

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Timmmm
Copy link
Contributor

@Timmmm Timmmm commented Dec 11, 2024

This adds two things:

  1. Custom CSS to add a subtle dotted underline on hover to any element with an ID starting with qx_ (an arbitrary prefix unlikely to be used by chance).
  2. An example tag qx_x0_is_zero, tagging the text that specifies that x0 is hardwired to 0.

This just adds a single tag as an exmaple, but the intention is that such tags would be added throughout the spec, allowing coverage, test plans, tests, documentation, etc. to all link to specific parts of the spec.

The text of these tags can also be extracted via Asciidoc's docbook output format, enabling more use cases such as monitoring for spec changes.

See #1397

@Timmmm
Copy link
Contributor Author

Timmmm commented Dec 11, 2024

It looks like this (when hovered):

image

This adds two things:

1. Custom CSS to add a subtle dotted underline on hover to any element with an ID starting with `qx_` (an arbitrary prefix unlikely to be used by chance).
2. An example tag `qx_x0_is_zero`, tagging the text that specifies that x0 is hardwired to 0.

This just adds a single tag as an exmaple, but the intention is that such tags would be added throughout the spec, allowing coverage, test plans, tests, documentation, etc. to all link to specific parts of the spec.

The text of these tags can also be extracted via Asciidoc's docbook output format, enabling more use cases such as monitoring for spec changes.
Copy link
Contributor

@james-ball-qualcomm james-ball-qualcomm left a comment

Choose a reason for hiding this comment

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

Will this tags.rb work for all adoc anchor types:

  • This is before the parameter definition. [#param-foo-1]#Here's a parameter defined using inline anchors.# This is after the parameter definition.
  • [#param-foo-2]
    Here's a parameter defined in its own block using the # ID syntax.
  • [[param-foo-3]]
    Here's a parameter defined using an anchor.

@@ -1,3 +1,3 @@
[submodule "docs-resources"]
path = docs-resources
url = https://github.com/riscv/docs-resources
url = https://github.com/Timmmm/docs-resources
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you really want to merge in this change? Shouldn't be be using the riscv and not the Timmmm submodule?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this was meant to be temporary just so it would pass CI. I'll make a PR for docs-resources later (yeay submodules!).

@@ -0,0 +1,22 @@
<style>
/*
Any ID starting with 'qx_' (arbitrarily chosen to be unlikely to
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we had settled on the "manual:" prefix. Can we use that instead of "qx_"? Will this cause any problems for the manual:priv and manual:unpriv anchors I recently added to the first block of the priv and unpriv manuals respectively (they used to have the same anchor name which doesn't work well when both priv and unpriv are in the same book). See #1841 for details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah I just haven't got around to updating it to manual: I will do that.

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