GithubHelp home page GithubHelp logo

maltfield / rtd-github-pages Goto Github PK

View Code? Open in Web Editor NEW
49.0 3.0 83.0 5.89 MB

Fork-ready base for your project's documentation using Sphinx + Read the Docs on GitHub Pages

Home Page: https://tech.michaelaltfield.net/2020/07/18/sphinx-rtd-github-pages-1/

License: GNU General Public License v3.0

Python 100.00%
continuous-documentation github-actions python read-the-docs rtd sphinx github-pages

rtd-github-pages's Introduction

docs_pages_workflow

Continuous Documentation: Hosting Read the Docs on GitHub Pages

This repo is a fork-ready base for your project's documentation. It lets you host a sphinx-generated site (with the Read the Docs theme) on GitHub Pages using GitHub Actions.

Continuous Documentation with Read the Docs on GitHub Pages using GitHub Actions

For more information, see this article:

How to use this repo

  1. Fork this repo
  2. On your forked repo, go to the "Actions" tab and click "I understand my workflows, go ahead and enable them" to enable GitHub workflows
  3. On your forked repo, go to the "Settings" tab. Under "GitHub Pages" choose 'gh-pages branch' under "Source"
  4. Make a small change to docs/index.rst
  5. git commit and git push something to trigger your site to be built

Every time you push to github.com on master, github will automatically spin up a container in their cloud to update your documentation.

After you begin to edit the contents of the site, you'll probably also want to customize the following files:

  1. docs/conf.py
  2. The python files in src/
  3. Other .rst files in docs/ as needed

For more details on how this works, see Continuous Documentation: Hosting Read the Docs on GitHub Pages

Demo

The GitHub-Pages-hosted "Hello World" example site built by this repo can be viewed here:

In the wild

The following Githb-Pages-hosted Read the Docs sites have been created by cloning this repo:

Local Iteration

As shown above, you can simply push your changes to GitHub to update your sphinx documentation website.

However, you can also build the site locally on your computer for faster iteration.

Linux

To build the site on Debian Linux, first download some dependencies

sudo apt-get update
sudo apt-get -y install git firefox-esr python3-git python3-sphinx python3-sphinx-rtd-theme

Change into the docs directory of this repo and build the sphinx site with make

cd rtd-github-pages/docs/
make clean
make html

You can view the site (built into the _build/html/ directory) using firefox

firefox-esr _build/html/index.html

License

The contents of this repo are dual-licensed. All code is GPLv3 and all other content is CC-BY-SA.

rtd-github-pages's People

Contributors

foobar2016 avatar maltfield avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rtd-github-pages's Issues

Web page suggestion: use git branch --set-upstream-to

In the web page https://tech.michaelaltfield.net/2020/07/23/sphinx-rtd-github-pages-2/ the git commands you describe are not bullet proof. I think you should add the following commands just after creating the dev branch (on the 'Versioning' chapter):

git branch --set-upstream-to=origin/master master
git branch --set-upstream-to=origin/dev dev

Otherwise, you'll get some errors in the following instructions, like what is reported here https://stackoverflow.com/questions/32056324/there-is-no-tracking-information-for-the-current-branch. You don't see these errors probably because you've cloned the repository and not set it up from scratch as you describe and as I've done.

Also, maybe you could move the instructions on how to "to install the git python module" here instead than later on the chapter "Updating buildDocs.sh"

seems like the build is broken again

Seems like the master branch isn't being built and docs 404.

I'm combing through my logs and noticed that my last successful job was Running Sphinx v5.3.0, but the newer 404'd job is Running Sphinx v1.8.4

I'll keep poking around.

search is broken

I've noticed that the search function is broken on your docs and mine. I'm not skilled enough to trace the issue, unfortunately.

Error in deployment: assets/css/style.scss

Hi I am trying to deploy a documentation website https://github.com/nekStab/nekStabDoc , and I have this error:

s@v1
/usr/bin/docker run --name ghcrioactionsjekyllbuildpagesv108_75c72d --label 94351b --workdir /github/workspace --rm -e "INPUT_SOURCE" -e "INPUT_DESTINATION" -e "INPUT_TOKEN" -e "INPUT_FUTURE" -e "INPUT_BUILD_REVISION" -e "INPUT_VERBOSE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/nekStabDoc/nekStabDoc":"/github/workspace" ghcr.io/actions/jekyll-build-pages:v1.0.8
Configuration file: none
Logging at level: debug
GitHub Pages: github-pages v228
GitHub Pages: jekyll v3.9.3
Theme: jekyll-theme-primer
Theme source: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0
Requiring: jekyll-github-metadata
To use retry middleware with Faraday v2.0+, install faraday-retry gem
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
No such file or directory @ dir_chdir - /github/workspace/docs
/usr/local/bundle/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:86:in chdir': No such file or directory @ dir_chdir - /github/workspace/docs (Errno::ENOENT) from /usr/local/bundle/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:86:in sass_load_paths'
from /usr/local/bundle/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:114:in sass_configs' from /usr/local/bundle/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:119:in convert'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:101:in block in convert' from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in each'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in reduce' from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in convert'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:83:in render_document' from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:62:in run'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:479:in render_regenerated' from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:472:in block in render_pages'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:471:in each' from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:471:in render_pages'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:192:in render' from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:71:in process'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/command.rb:28:in process_site' from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:65:in build'
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:36:in process' from /usr/local/bundle/gems/github-pages-228/bin/github-pages:70:in block (3 levels) in <top (required)>'
Requiring: jekyll-seo-tag
Requiring: jekyll-coffeescript
Requiring: jekyll-commonmark-ghpages
Requiring: jekyll-gist
Requiring: jekyll-github-metadata
Requiring: jekyll-paginate
Requiring: jekyll-relative-links
Requiring: jekyll-optional-front-matter
Requiring: jekyll-readme-index
Requiring: jekyll-default-layout
Requiring: jekyll-titles-from-headings
GitHub Metadata: Initializing...
Source: /github/workspace/./docs
Destination: /github/workspace/./docs/_site
Incremental build: disabled. Enable with --incremental
Generating...
Generating: JekyllOptionalFrontMatter::Generator finished in 1.3e-05 seconds.
Generating: JekyllReadmeIndex::Generator finished in 5.7e-06 seconds.
Generating: Jekyll::Paginate::Pagination finished in 4.1e-06 seconds.
Generating: JekyllRelativeLinks::Generator finished in 3.11e-05 seconds.
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each'
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go'
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program' from /usr/local/bundle/gems/github-pages-228/bin/github-pages:6:in <top (required)>'
from /usr/local/bundle/bin/github-pages:23:in load' from /usr/local/bundle/bin/github-pages:23:in

'
Generating: JekyllDefaultLayout::Generator finished in 1.23e-05 seconds.
Generating: JekyllTitlesFromHeadings::Generator finished in 7.0e-06 seconds.
Rendering: assets/css/style.scss
Pre-Render Hooks: assets/css/style.scss
Rendering Markup: assets/css/style.scss
github-pages 228 | Error: No such file or directory @ dir_chdir - /github/workspace/docs

any ideas what is going wrong? I renamed the branch from master to main and adjusted where necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.