Skip to content

Commit

Permalink
Extract setup script
Browse files Browse the repository at this point in the history
Extracted setup script to a separate document
It was making the readme too long
  • Loading branch information
ColmBhandal committed Oct 11, 2023
1 parent d4a7117 commit 03a8939
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 34 deletions.
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ More information is available in the `reStructuredText style guide`_.
:maxdepth: 2

ReadMe <readme>
Setup Script <setup-script>
36 changes: 2 additions & 34 deletions readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ You can either create a standalone documentation project based on this repositor

**Note:** We're planning to provide the contents of this repository as an installable package in the future, but currently, you need to copy and update the required files manually.

The next two sections provide manual steps for enabling the starter pack for your repository. See :doc:`setup-script` for an automated method (currently in beta).

Standalone documentation repository
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -289,40 +291,6 @@ Change log

See the `change log <https://github.com/canonical/sphinx-docs-starter-pack/wiki/Change-log>`_ for a list of relevant changes to the starter pack.

Beta feature: setup script
---------------------------

An alternative to the manual setup steps is to use a setup script to automatically initialise your repository using the starter pack. This script is provided as a beta feature: use it with care and check all changes manually before committing them to your repository.

Prerequisites
~~~~~~~~~~~~~

Before you begin, ensure you have the following:

* A GitHub repository where you want to host your documentation, cloned to your local machine. The recommended approach is to host the documentation alongside your code in a `docs` folder. But a standalone documentation repository is also an option; in this case, start with an empty repository.
* Git and Bash installed on your system.

Initialise your documentation repository
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``init.sh`` Bash script is used to initialise your repository with the starter pack content. It adds all the files to your repository that are needed to get started with Sphinx documentation.

To use the script, follow these steps:

* Copy ``init.sh`` to your repository's root directory.
* Run the script: ``./init.sh``
* Enter the installation directory when prompted. For standalone repositories, enter ".". For documentation alongside code, enter the folder where your documentation are e.g. "docs".

This Bash script does the following:

* Clones the starter pack GitHub repository
* Creates the specified installation directory if necessary
* Updates working directory paths in workflow files, and updates configuration paths in the ``.readthedocs.yaml`` file
* Copies and moves contents and ``.github`` files from the starter pack to the installation directory
* Deletes the cloned repository when it's done

When the script completes, review all changes before committing, then commit your changes.

.. LINKS
.. wokeignore:rule=master
Expand Down
34 changes: 34 additions & 0 deletions setup-script.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Setup script
============

An alternative to the manual setup steps is to use a setup script to automatically initialise your repository using the starter pack. This script is provided as a beta feature: use it with care and check all changes manually before committing them to your repository.

Prerequisites
~~~~~~~~~~~~~

Before you begin, ensure you have the following:

* A GitHub repository where you want to host your documentation, cloned to your local machine. The recommended approach is to host the documentation alongside your code in a `docs` folder. But a standalone documentation repository is also an option; in this case, start with an empty repository.
* Git and Bash installed on your system.

Initialise your documentation repository
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``init.sh`` Bash script is used to initialise your repository with the starter pack content. It adds all the files to your repository that are needed to get started with Sphinx documentation.

To use the script, follow these steps:

* Copy ``init.sh`` to your repository's root directory.
* Run the script: ``./init.sh``
* Enter the installation directory when prompted. For standalone repositories, enter ".". For documentation alongside code, enter the folder where your documentation are e.g. "docs".

This Bash script does the following:

* Clones the starter pack GitHub repository
* Creates the specified installation directory if necessary
* Updates working directory paths in workflow files, and updates configuration paths in the ``.readthedocs.yaml`` file
* Copies and moves contents and ``.github`` files from the starter pack to the installation directory
* Deletes the cloned repository when it's done

When the script completes, review all changes before committing, then commit your changes.

0 comments on commit 03a8939

Please sign in to comment.