-
Notifications
You must be signed in to change notification settings - Fork 229
Docs and Web: Add to the master branch and build with each push #764
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2c4698e
docs: Build function docs from docstrings
zacikpa cb0261e
docs: Update built-in function docstrings
zacikpa 87f0f99
functions: Use CapWords for function classes
zacikpa 422f14b
functions: Remove unused imports
zacikpa ceb1ae6
functions: Derive function name from module name
zacikpa a9a4936
web: Add a workflow for Github Pages
zacikpa d0957d5
docs: Fix typos
zacikpa 8d478f7
docs: Replace yum with dnf
zacikpa 9f217a4
docs: Restructure sections
zacikpa 68f98fb
docs: Use variables for profile directories
zacikpa 880a28f
docs: Remove links to RH docs
zacikpa 9e88d33
docs: Bump revnumber and revdate
zacikpa 0222cbf
vm: Document dirty_bytes and dirty_background_bytes
zacikpa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Deploy TuneD website to Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout the master branch | ||
| uses: actions/checkout@v4 | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt install -y make asciidoctor | ||
| - name: Build the manual | ||
| run: make -C doc/manual | ||
| - name: Prepare the website contents | ||
| run: | | ||
| git fetch origin gh-pages:gh-pages | ||
| git clone -b gh-pages . _site | ||
| cp doc/manual/index.html _site/docs/manual.html | ||
| - name: Setup Pages | ||
| id: pages | ||
| uses: actions/configure-pages@v5 | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,14 @@ | ||
| .PHONY: clean | ||
|
|
||
| index.html: master.adoc assemblies/*.adoc meta/*.adoc modules/performance/*.adoc ../../tuned/plugins/plugin_*.py | ||
| $(PYTHON) ../../compile_plugin_docs.py modules/performance/ref_available-tuned-plug-ins_intro.adoc modules/performance/ref_available-tuned-plug-ins.adoc | ||
| index.html: master.adoc assemblies/*.adoc meta/*.adoc modules/performance/*.adoc ../../tuned/plugins/plugin_*.py ../../tuned/profiles/functions/function_*.py | ||
| $(PYTHON) ./compile_plugin_docs.py ../../tuned/plugins plugin_ Plugin modules/performance/ref_available-tuned-plug-ins_intro.adoc modules/performance/ref_available-tuned-plug-ins.adoc | ||
| $(PYTHON) ./compile_plugin_docs.py ../../tuned/profiles/functions function_ Function modules/performance/ref_built-in-functions-available-in-tuned-profiles_intro.adoc modules/performance/ref_built-in-functions-available-in-tuned-profiles.adoc | ||
| asciidoctor -o index.html master.adoc || asciidoc -d book -o index.html master.adoc | ||
|
|
||
| install: index.html | ||
| install -Dpm 0644 index.html $(DESTDIR)$(DOCDIR)/manual/index.html | ||
|
|
||
| clean: | ||
| rm -f modules/performance/ref_available-tuned-plug-ins.adoc | ||
| rm -f modules/performance/ref_built-in-functions-available-in-tuned-profiles.adoc | ||
| rm -f *.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| #!/usr/bin/env python3 | ||
| import argparse | ||
| import ast | ||
| import os | ||
| import inspect | ||
|
|
||
|
|
||
| class DocLoader: | ||
| def __init__(self, directory, prefix, base): | ||
| self._directory = directory | ||
| self._prefix = prefix | ||
| self._base = base | ||
|
|
||
| def _load_doc(self, module_path): | ||
| with open(module_path, "r") as file: | ||
yarda marked this conversation as resolved.
Fixed
Show fixed
Hide fixed
|
||
| tree = ast.parse(file.read(), filename=module_path) | ||
| for node in ast.walk(tree): | ||
| if isinstance(node, ast.ClassDef) and any( | ||
| hasattr(base, "attr") and base.attr == self._base for base in node.bases | ||
| ): | ||
| return inspect.cleandoc(ast.get_docstring(node)) | ||
| return "" | ||
|
|
||
| def load_all_docs(self): | ||
| docs = {} | ||
| for filename in os.listdir(self._directory): | ||
| if not filename.startswith(self._prefix): | ||
| continue | ||
| name = filename.split(".")[0].split("_", 1)[1] | ||
| path = os.path.join(self._directory, filename) | ||
| docs[name] = self._load_doc(path) | ||
| return docs | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("directory") | ||
| parser.add_argument("prefix") | ||
| parser.add_argument("base") | ||
| parser.add_argument("intro") | ||
| parser.add_argument("out") | ||
| args = parser.parse_args() | ||
|
|
||
| with open(args.intro, "r") as intro_file: | ||
| intro = intro_file.read() | ||
|
|
||
| doc_loader = DocLoader(args.directory, args.prefix, args.base) | ||
| class_docs = doc_loader.load_all_docs() | ||
|
|
||
| with open(args.out, "w") as out_file: | ||
| out_file.write(intro) | ||
| for name, docs in class_docs.items(): | ||
| out_file.writelines(["\n", "== **%s**\n" % name, "%s\n" % docs]) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| :system-profile-dir: /usr/lib/tuned/profiles | ||
| :user-profile-dir: /etc/tuned/profiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
doc/manual/modules/performance/con_syntax-of-profile-configuration.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| :_module-type: CONCEPT | ||
| [id="syntax-of-profile-configuration_{context}"] | ||
| = Syntax of profile configuration | ||
|
|
||
| [role="_abstract"] | ||
| The `tuned.conf` file uses INI syntax. It can contain one `[main]` section and other sections for configuring plug-in instances. However, all sections are optional. | ||
|
|
||
| Lines starting with the hash sign (`#`) are comments. | ||
|
|
||
| [role="_additional-resources"] | ||
| .Additional resources | ||
| * `tuned.conf(5)` man page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.