-
Notifications
You must be signed in to change notification settings - Fork 76
Documentation Site #38
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
Open
s2t2
wants to merge
21
commits into
stanfordio:main
Choose a base branch
from
s2t2:docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
725de66
Touch file, remove special chars
s2t2 7c326a7
Generate quarto project
s2t2 e331d98
Auto-generate docs
s2t2 df799ee
Customize the reference index
s2t2 fa6b7ce
Customize index page
s2t2 5c9ab3f
Fix tests, update docs
s2t2 47eafc3
Continuous Integration maybe
s2t2 d12bb5e
Attempt to overcome package installation issue on CI
s2t2 8532368
Attempt to use poetry on GitHub Actions
s2t2 b5cf323
Attempt to run tests within poetry env on GitHub Actions
s2t2 289e97a
Authenticate on CI
s2t2 0514cbb
Attempt to run GitHub Pages build
s2t2 1ccad3d
Note about environment variables
s2t2 493901f
Use markdown for examples in docstring
s2t2 bf89bbe
Merge upstream; update lockfile; resolve conflicts
s2t2 4413eb7
Run workflow on push only; avoid duplicate on PR
s2t2 6e29a05
Test topics
s2t2 b8ee9c2
Fix test
s2t2 9dd9903
Fix conflict
s2t2 8497b8e
Update docs
s2t2 56c11cc
Merge remote-tracking branch 'origin' into docs
s2t2 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,68 @@ | ||
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
|
||
| name: Python application | ||
|
|
||
| on: | ||
| push: | ||
| #branches: [ "main" ] | ||
| #pull_request: | ||
| #branches: [ "main" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # PYTHON | ||
|
|
||
| - name: Set up Python 3.10 | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: "3.10" | ||
|
|
||
| # INSTALL PACKAGES | ||
|
|
||
| #- name: Install dependencies | ||
| # run: | | ||
| # python -m pip install --upgrade pip | ||
| # pip install flake8 pytest | ||
| # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
|
|
||
| # TODO: use poetry instead! | ||
| # poetry install --with test,docs | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
|
|
||
| - name: Install dependencies with Poetry | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install flake8 pytest | ||
| poetry --version | ||
| poetry install | ||
|
|
||
| # LINTING | ||
|
|
||
| - name: Lint with flake8 | ||
| run: | | ||
| # stop the build if there are Python syntax errors or undefined names | ||
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
|
|
||
| # TESTS | ||
|
|
||
| - name: Test with pytest | ||
| env: | ||
| # set environment variable to use during testing | ||
| TRUTHSOCIAL_USERNAME: ${{ secrets.TRUTHSOCIAL_USERNAME }} | ||
| TRUTHSOCIAL_PASSWORD: ${{ secrets.TRUTHSOCIAL_PASSWORD }} | ||
| run: | | ||
| poetry run pytest |
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,103 @@ | ||
|
|
||
| # https://jupyterbook.org/en/stable/publish/gh-pages.html | ||
|
|
||
| name: quarto-pages | ||
|
|
||
| on: | ||
| push: | ||
| #branches: | ||
| #- main | ||
| # If your git repository has the Jupyter Book within some-subfolder next to | ||
| # unrelated files, you can make this run only if a file within that specific | ||
| # folder has been modified. | ||
| # | ||
| #paths: | ||
| #- docs/** | ||
|
|
||
| #pull_request: | ||
| #branches: [ "main" ] | ||
|
|
||
| # make this workflow manually runnable | ||
| # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | ||
| workflow_dispatch: | ||
|
|
||
|
|
||
| jobs: | ||
| deploy-book: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pages: write | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| # | ||
| # PYTHON STUFF | ||
| # | ||
|
|
||
| - name: Install Python 3.11 | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: 3.11 | ||
|
|
||
| # PACKAGE DEPENDENCIES | ||
|
|
||
| #- name: Install dependencies | ||
| # run: | | ||
| # pip install -r requirements.txt | ||
|
|
||
| # INSTALL DOCUMENTATION DEPENDENCIES | ||
| #- name: Install docs dependencies | ||
| # run: | | ||
| # pip install -r docs/requirements.txt | ||
|
|
||
| # TODO: use poetry instead! | ||
| # https://github.com/marketplace/actions/python-poetry-action | ||
| # poetry install --with test,docs | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
|
|
||
| # https://python-poetry.org/docs/managing-dependencies/#dependency-groups | ||
| - name: Install dependencies with Poetry | ||
| run: | | ||
| poetry install --with docs | ||
|
|
||
|
|
||
|
|
||
| # | ||
| # QUARTO STUFF | ||
| # | ||
|
|
||
| # INSTALL QUARTO | ||
| # https://github.com/quarto-dev/quarto-actions/blob/main/examples/quarto-publish-example.yml | ||
| - name: Set up Quarto | ||
| uses: quarto-dev/quarto-actions/setup@v2 | ||
| #env: | ||
| # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| # To install LaTeX to build PDF book | ||
| # (to get past errors on the CI build) | ||
| tinytex: true | ||
| # uncomment below and fill to pin a version | ||
| # version: SPECIFIC-QUARTO-VERSION-HERE | ||
|
|
||
| # RENDER WEBSITE CONTENTS TO DOCS/_BUILD | ||
| - name: Build the docs | ||
| run: | | ||
| quarto render docs/ | ||
|
|
||
| # | ||
| # GITHUB PAGES STUFF | ||
| # | ||
|
|
||
| # UPLOAD CONTENTS OF DOCS/_BUILD | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v2 | ||
| with: | ||
| path: "docs/_build" | ||
|
|
||
| # DEPLOY WEBSITE CONTENTS TO GITHUB PAGES | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v2 | ||
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,16 @@ | ||
|
|
||
|
|
||
|
|
||
| build-docs: | ||
| rm -rf docs/reference | ||
| quartodoc build --config docs/_quarto.yml --verbose | ||
| quarto render docs/ | ||
| # open docs/_build/index.html | ||
|
|
||
| open-docs: | ||
| open docs/_build/index.html | ||
|
|
||
| preview-docs: | ||
| rm -rf docs/reference | ||
| quartodoc build --config docs/_quarto.yml | ||
| quarto preview 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,3 @@ | ||
| /.quarto/ | ||
|
|
||
| *.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Truthbrush Documentation Site | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ### Quarto | ||
|
|
||
| The documentation site is built using [Quarto](https://quarto.org/). Quarto can be [downloaded](https://quarto.org/docs/get-started/), or [installed via homebrew](https://formulae.brew.sh/cask/quarto) (if you like that kind of thing): | ||
|
|
||
| ```sh | ||
| brew install --cask quarto | ||
| ``` | ||
|
|
||
| If you use VS Code, you can also consider installing the [Quarto Extension](https://marketplace.visualstudio.com/items?itemName=quarto.quarto). | ||
|
|
||
|
|
||
| ## Docs Environment | ||
|
|
||
| Setup environment and install package dependencies: | ||
|
|
||
| ```sh | ||
| conda create -n truthbrush-docs python=3.10 | ||
| conda activate truthbrush-docs | ||
|
|
||
| conda install -c conda-forge poetry | ||
| poetry install --with docs | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Auto Documentation | ||
|
|
||
| In the "quartodoc" section of the ["_quarto.yml" config file](/docs/_quarto.yml), we specify that our site should display "references/index.qmd", which acts as the entrypoint into the package auto-documentation. | ||
|
|
||
| We are using [quartodoc](https://machow.github.io/quartodoc/get-started/basic-docs.html) to automatically generate docstring content into the "docs/references" directory: | ||
|
|
||
| ```sh | ||
| quartodoc build --config docs/_quarto.yml --verbose | ||
| ``` | ||
|
|
||
| After the documentation pages have been generated, then we can preview and build the site. | ||
|
|
||
|
|
||
| ## Building | ||
|
|
||
|
|
||
| Previewing the site (runs like a local webserver): | ||
|
|
||
| ```sh | ||
| quarto preview docs/ | ||
| ``` | ||
|
|
||
|
|
||
| Rendering the site (writes local HTML files to the "docs/_build" directory, which is ignored from version control): | ||
|
|
||
| ```sh | ||
| quarto render docs/ --verbose | ||
| ``` | ||
|
|
||
|
|
||
| ### Website Publishing | ||
|
|
||
| We are using the ["quarto-pages.yml" workflow configuration file](/.github/workflows/quarto-pages.yml) to deploy the site to GitHub Pages when new commits are pushed to the main branch. | ||
|
|
||
| In order for this to work, the GitHub Pages repo settings need to be configured to publish via GitHub Actions. |
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,84 @@ | ||
| project: | ||
| type: website | ||
| output-dir: _build | ||
| preview: | ||
| #port: 5554 # use the same port instead of a new one each time | ||
| browser: true | ||
|
|
||
| website: | ||
| title: "Truthbrush Documentation Site" | ||
|
|
||
| site-url: https://stanfordio.github.io/truthbrush/ | ||
| repo-url: https://github.com/stanfordio/truthbrush | ||
| repo-branch: main | ||
| repo-subdir: docs | ||
| repo-actions: [edit, issue, source] | ||
|
|
||
| search: true | ||
| page-navigation: true # adds buttons at bottom of page | ||
|
|
||
| navbar: | ||
| right: | ||
| - href: index.qmd | ||
| text: Home | ||
| - about.qmd | ||
|
|
||
| sidebar: | ||
| contents: | ||
| - href: index.qmd | ||
| text: Home | ||
|
|
||
| - section: | ||
| href: reference/index.qmd | ||
| title: "Truthbrush Package Reference" | ||
| contents: | ||
| - href: reference/api.Api.qmd | ||
| text: "API Reference" | ||
| - href: reference/cli.qmd | ||
| text: "CLI Reference" | ||
|
|
||
|
|
||
|
|
||
| format: | ||
| html: | ||
| theme: cosmo | ||
| css: styles.css | ||
| toc: true | ||
| #code-copy: true | ||
|
|
||
|
|
||
| # | ||
| # PYTHON PACKAGE AUTO-DOCUMENTATION | ||
| # | ||
|
|
||
| # https://machow.github.io/quartodoc/get-started/basic-docs.html | ||
| quartodoc: | ||
| # the name used to import the package you want to create reference docs for | ||
| package: truthbrush | ||
| #version: "v1.0.1" | ||
|
|
||
| # directory relative to current (docs/) | ||
| dir: reference | ||
|
|
||
| #style: pkgdown | ||
|
|
||
| parser: google # "numpy" or "google" or "sphinx" | ||
|
|
||
| title: Truthbrush Package Reference | ||
|
|
||
| sections: | ||
| - title: API Reference | ||
| desc: Functions related to the Python API. | ||
| contents: | ||
| - api.Api | ||
|
|
||
| #- title: API Reference | ||
| # desc: Functions related to the Python API. | ||
| # package: truthbrush.api | ||
| # contents: | ||
| # - Api | ||
|
|
||
| - title: CLI Reference | ||
| desc: Functions related to the command line interface (CLI). | ||
| contents: | ||
| - cli |
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,5 @@ | ||
| --- | ||
| title: "About" | ||
| --- | ||
|
|
||
| About this site |
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,7 @@ | ||
| --- | ||
| title: "Docs" | ||
| --- | ||
|
|
||
| This is a Quarto website. | ||
|
|
||
| To learn more about Quarto websites visit <https://quarto.org/docs/websites>. |
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 @@ | ||
| {"project": "truthbrush", "version": "0.0.9999", "count": 27, "items": [{"name": "truthbrush.api.Api.ads", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.ads", "dispname": "-"}, {"name": "truthbrush.api.Api.get_auth_id", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.get_auth_id", "dispname": "-"}, {"name": "truthbrush.api.Api.group_tags", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.group_tags", "dispname": "-"}, {"name": "truthbrush.api.Api.lookup", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.lookup", "dispname": "-"}, {"name": "truthbrush.api.Api.pull_statuses", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.pull_statuses", "dispname": "-"}, {"name": "truthbrush.api.Api.search", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.search", "dispname": "-"}, {"name": "truthbrush.api.Api.suggested", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.suggested", "dispname": "-"}, {"name": "truthbrush.api.Api.suggested_groups", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.suggested_groups", "dispname": "-"}, {"name": "truthbrush.api.Api.tags", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.tags", "dispname": "-"}, {"name": "truthbrush.api.Api.trending", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.trending", "dispname": "-"}, {"name": "truthbrush.api.Api.trending_groups", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.trending_groups", "dispname": "-"}, {"name": "truthbrush.api.Api.user_likes", "domain": "py", "role": "function", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api.user_likes", "dispname": "-"}, {"name": "truthbrush.api.Api", "domain": "py", "role": "class", "priority": "1", "uri": "reference/api.Api.html#truthbrush.api.Api", "dispname": "-"}, {"name": "truthbrush.cli.ads", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.ads", "dispname": "-"}, {"name": "truthbrush.cli.cli", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.cli", "dispname": "-"}, {"name": "truthbrush.cli.groupposts", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.groupposts", "dispname": "-"}, {"name": "truthbrush.cli.groupsuggest", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.groupsuggest", "dispname": "-"}, {"name": "truthbrush.cli.grouptags", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.grouptags", "dispname": "-"}, {"name": "truthbrush.cli.grouptrends", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.grouptrends", "dispname": "-"}, {"name": "truthbrush.cli.likes", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.likes", "dispname": "-"}, {"name": "truthbrush.cli.search", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.search", "dispname": "-"}, {"name": "truthbrush.cli.statuses", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.statuses", "dispname": "-"}, {"name": "truthbrush.cli.suggestions", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.suggestions", "dispname": "-"}, {"name": "truthbrush.cli.tags", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.tags", "dispname": "-"}, {"name": "truthbrush.cli.trends", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.trends", "dispname": "-"}, {"name": "truthbrush.cli.user", "domain": "py", "role": "function", "priority": "1", "uri": "reference/cli.html#truthbrush.cli.user", "dispname": "-"}, {"name": "truthbrush.cli", "domain": "py", "role": "module", "priority": "1", "uri": "reference/cli.html#truthbrush.cli", "dispname": "-"}]} |
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.