Local preview page revived to pair with local authoring environment

This commit is contained in:
hank L 2023-03-12 19:03:33 +00:00
commit 3ec3260674
2 changed files with 39 additions and 9 deletions

View file

@ -19,6 +19,7 @@
*** How to profoundly use the Gitlab web IDE (permanent members)
//** xref:contributing-docs/use-file-edit-if.adoc[How to profoundly use Pagure (permanent members)]
*** xref:contributing-docs/tools-local-authoring-env.adoc[How to create and use a local Fedora authoring environment]
*** xref:contributing-docs/tools-localenv-preview.adoc[How to run a local preview]
*** xref:contributing-docs/tools-vale-linter.adoc[How to check documentation style with Vale]
** xref:contributing-docs/style-guide.adoc[The docs style guide]
@ -28,11 +29,9 @@
// ** xref:contributing-docs/translations.adoc[Working with Translations]
** Working with Translations
//* Contribute to keeping Docs up and running
* xref:contributing-infra/index.adoc[Contribute to keeping docs up and running]
** xref:contributing-infra/design-ux-contribution.adoc[Design the user interface for Docs]
//* xref:archive/index.adoc[What we have achieved so far]
* What we have achieved so far
* What we have achieved so far

View file

@ -1,17 +1,48 @@
= Building a local preview
Fedora Documentation Team <https://discussion.fedoraproject.org/tag/docs>
v0.0.1, 2022-09-26
:revdate: 2023-03-12
Because the documentation site is using a markup language instead of a WYSIWYG editor, the sources do not look exactly like the rendered page will. Therefore it is necessary to check that your changes look the way you want them to before you push and make a pull request. This involves building a local preview.
[abstract]
A local preview is a valuable tool to test your changes when working on your local authoring environment. Run shell scripts available in Fedora content repository: `build.sh` and `preview.sh`. You can build and run the fully rendered site on your machine to preview your changes before making a pull request to the Fedora content repositories. Some Fedora content repositories have the builder.sh script that you can use in lieu of the build.sh and preview.sh scripts.
There are two shell scripts available in each existing repository (including the template repository used to create new content): `build.sh` and `preview.sh`.
== When you need a local preview
When working with local authoring environment, a local preview provides versatile workflow to test how the changes will be rendered and function in your browser locally. When you make changes such as, but not limited to;
- Change links or fix broken links
- Consolidate multiple pages into one page
- Update images of fix broken images
- Add metadata or alt text for images
- Section levels reorganized (Example: h2 to h3, h3 to h4) for readability and reading flow
- Fix inactive navigation bar in nav.adoc
- Reorganize navigation bar
- Rewrite outdated pages
- Reiterate changes with vale linter
you need build scripts to render the changes predictably and test them before you make a pull request.
== What the scripts do
The build.sh script is the one that actually builds a local version of the site, which means the subset of the full site that resides in your local repository. The preview.sh script starts a webserver and serves the site at link:http://localhost:8080/[]. Opening this link in any web browser will show you the preview, which will be available until you kill the process (kbd:[Ctrl+C] in the terminal).
=== How to test changes
Go to the the directory where cloned repo is, build, watch and preview the site by running the build scripts in terminal.
----
$ ./build.sh && ./preview.sh
----
Pagure or other content repositories display a different builder script. Check README.md on the landing page of projects and run the script suggested to use.
----
$ ./builder.sh
----
To preview, run the `build.sh` script; this is the one that actually builds a local version of the site (or, more precisely, the subset of the full site that resides in your current repository). Then, run `preview.sh`, which starts a webserver and serves the site at link:http://localhost:8080/[]. Opening this URL in any web browser will show you the preview, which will be available until you kill the process (kbd:[Ctrl+C] in the terminal).
[NOTE]
====
To run the scripts you'll need to install [application]`Podman` if using a Linux OS such as Fedora or [application]`Docker CE` if using macOS.
To use the scripts you need [application]`Podman` installed if using Fedora Linux or [application]`Docker CE` if using macOS.
====
== Previewing multiple repositories