Skip to content

Commit

Permalink
Update the documentation page in the About section
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed Nov 11, 2023
1 parent 8a5c12d commit c1c5522
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 48 deletions.
20 changes: 7 additions & 13 deletions source/about/docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ Documentation
*************

This website includes the :ref:`documentation <main_documentation>` for the latest full release of
novelWriter as a convenience. However, the main documentation page is hosted on ReadTheDocs. The
version hosted there has documentation available for multiple releases of novelWriter, including
for the current development efforts.
novelWriter. This is the main and updated source of documentation.

The "Stable" version of the documentation always points to the latest release, and should be the
same documentation as available on this website.
PDF Manuals
===========

The "Latest" version is the documentation for the next release (minor or major) of novelWriter, and
may include information that does not match with the version you have installed.
A selection of PDF manuals are available here for download, including for earlier versions of novelWriter:

At the bottom of the left hand menu of the documentation, you can find a small box to change which
version of the documentation to display. As a general rule the last 10 patched releases should be
available in the list.

| :octicon:`book` `ReadTheDocs: Stable novelWriter Documentation <https://novelwriter.readthedocs.io/en/stable/>`__
| :octicon:`book` `ReadTheDocs: Latest novelWriter Documentation <https://novelwriter.readthedocs.io/en/latest/>`__
| :download:`novelWriter-2.1.pdf`
| :download:`novelWriter-2.0.pdf`
| :download:`novelWriter-1.6.pdf`
File renamed without changes.
File renamed without changes.
Binary file not shown.
4 changes: 2 additions & 2 deletions source/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Documentation

| **Release Version:** 2.1.1
| **Release Date:** Sunday, 5 November 2023
| **Docs Updated:** Sunday, 5 November 2023
| **Docs Updated:** Saturday, 11 November 2023
**PDF:** :download:`novelWriter-2.1.pdf <../download/novelWriter-2.1.pdf>` [ :ref:`Older Versions <main_download_pdfs>` ]
**PDF:** :download:`novelWriter-2.1.pdf <../about/novelWriter-2.1.pdf>` [ :ref:`Older Versions <main_about_docs>` ]

novelWriter is an open source plain text editor designed for writing novels assembled from many
smaller text documents. It uses a minimal formatting syntax inspired by Markdown, and adds a meta
Expand Down
6 changes: 0 additions & 6 deletions source/download/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ Downloads

help_win

.. toctree::
:caption: Documentation PDFs
:hidden:

pdf_docs

This page includes all available packages for the latest release.

When pre-release packages for the next version of novelWriter are available, these release packages
Expand Down
11 changes: 0 additions & 11 deletions source/download/pdf_docs.rst

This file was deleted.

13 changes: 13 additions & 0 deletions templates/about_docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _main_about_docs:

*************
Documentation
*************

This website includes the :ref:`documentation <main_documentation>` for the latest full release of
novelWriter. This is the main and updated source of documentation.

PDF Manuals
===========

A selection of PDF manuals are available here for download, including for earlier versions of novelWriter:
23 changes: 7 additions & 16 deletions tools/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def __init__(self, target: str, isBranch=False):

self._tempDir = ROOT_DIR / "_temp"
self._extPath = self._tempDir / "novelWriter"
self._tplPath = ROOT_DIR / "templates"
self._dstPath = ROOT_DIR / "source" / "docs"
self._pdfPath = ROOT_DIR / "source" / "download"
self._pdfPath = ROOT_DIR / "source" / "about"

self._nwRelease = "Unknown"
self._nwDate = "1970-01-01"
Expand Down Expand Up @@ -136,19 +137,9 @@ def _createPdfPage(self):
key = f"{int(bits[0]):02d}.{int(bits[1]):03d}"
pdfs.append((key, item.name))

with open(self._pdfPath / "pdf_docs.rst", mode="w", encoding="utf-8") as of:
of.write(
".. _main_download_pdfs:\n"
"\n"
"******************\n"
"Documentation PDFs\n"
"******************\n"
"\n"
"The current documentation for the latest version is available on the "
":ref:`main_documentation` page. This page contains PDFs for the current and "
"earlier versions.\n"
"\n"
)
with open(self._pdfPath / "docs.rst", mode="w", encoding="utf-8") as of:
of.write((self._tplPath / "about_docs.rst").read_text(encoding="utf-8"))
of.write("\n")
for _, pdf in sorted(pdfs, key=lambda x: x[0], reverse=True):
of.write(f"| :download:`{pdf}`\n")
return
Expand Down Expand Up @@ -184,8 +175,8 @@ def _rewriteIndex(self, indexFile: Path):
"",
(
f"**PDF:** :download:`novelWriter-{self._nwMajor}.{self._nwMinor}.pdf "
f"<../download/novelWriter-{self._nwMajor}.{self._nwMinor}.pdf>` "
"[ :ref:`Older Versions <main_download_pdfs>` ]"
f"<../about/novelWriter-{self._nwMajor}.{self._nwMinor}.pdf>` "
"[ :ref:`Older Versions <main_about_docs>` ]"
),
"",
]
Expand Down

0 comments on commit c1c5522

Please sign in to comment.