%global _empty_manifest_terminate_build 0
Name: python-pretextbook
Version: 0.8.3
Release: 1
Summary: A package to author, build, and deploy PreTeXt projects.
License: GPL-3.0-or-later
URL: https://pypi.org/project/pretextbook/
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/61/60/0b594990c1fcbf9a90408207a711b345508b0d3ae813a4813b0ea02a1d8f/pretextbook-0.8.3.tar.gz
BuildArch: noarch
Requires: python3-lxml
Requires: python3-requests
Requires: python3-watchdog
Requires: python3-GitPython
Requires: python3-click
Requires: python3-pdfCropMargins
Requires: python3-PyPDF2
Requires: python3-click-log
Requires: python3-ghp-import
Requires: python3-single-version
Requires: python3-CodeChat-Server
Requires: python3-pyppeteer
%description
# PreTeXt-CLI
A package for authoring and building [PreTeXt](https://pretextbook.org) documents.
- GitHub:
## Documentation and examples for authors/publishers
Most documentation for PreTeXt authors and publishers is available at:
-
Authors and publishers may also find the examples catalog useful as well:
-
We have a few notes below (TODO: publish these in the Guide).
### Installation
#### Installing Python
PreTeXt-CLI requires the Python version specified in `pyproject.toml`.
To check your version, type this into your terminal or command prompt:
```
python -V
```
If your version is 2.x, try this instead
(and if so, either replace all future references to `python`
in these instructions with `python3`).
```
python3 -V
```
If you don't have a compatible Python available, try one of these:
- https://www.python.org/downloads/
- Windows warning: Be sure to select the option adding Python to your Path.
- https://github.com/pyenv/pyenv#installation (Mac/Linux)
- https://github.com/pyenv-win/pyenv-win#installation (Windows)
#### Installing PreTeXt-CLI
Once you've confirmed that you're using a valid version of Python, just
run (replacing `python` with `python3` if necessary):
```
python -m pip install --user pretextbook
```
(It's also possible you may get an error like
`error: invalid command 'bdist_wheel'`
— good news, you can ignore it!)
After installation, try to run:
```
pretext --help
```
If that works, great! Otherwise, it likely means that Python packages
aren't available on your “PATH”. In that case, replace all `pretext`
commands with `python -m pretext` instead:
```
python -m pretext --help
```
Either way, you're now ready to use the CLI, the `--help` option will explain how to use all the different
subcommands like `pretext new` and `pretext build`.
#### External dependencies
We install as much as we can with the `pip install` command, but depending on your machine
you may require some extra software:
- [TeXLive](https://www.tug.org/texlive/)
- [pdftoppm/Ghostscript](https://github.com/abarker/pdfCropMargins/blob/master/doc/installing_pdftoppm_and_ghostscript.rst)
#### Upgrading PreTeXt-CLI
If you have an existing installation and you want to upgrade to a more recent version, you can run:
```
python -m pip install --upgrade pretextbook
```
#### Custom XSL
Custom XSL is not encouraged for most authors, but (for example) developers working
bleeding-edge XSL from core PreTeXt may want to call XSL different from that
which is shipped with a fixed version of the CLI. This may be accomplished by
adding an `` element to your target with a relative (to `project.ptx`) or
absolute path to the desired XSL. *(Note: this XSL must only import
other XSL files in the same directory or within subdirectories.)*
For example:
```
htmlsource/main.ptxpublication/publication.ptxoutput/html../pretext/xsl/pretext-html.xsl
```
If your custom XSL file needs to import the XSL
shipped with the CLI (e.g. `pretext-common.xsl`), then use a `./core/`
prefix in your custom XSL's `xsl:import@href` as follows:
```
```
Similarly, `entities.ent` may be used:
```
%entities;
]>
```
%package -n python3-pretextbook
Summary: A package to author, build, and deploy PreTeXt projects.
Provides: python-pretextbook
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-pretextbook
# PreTeXt-CLI
A package for authoring and building [PreTeXt](https://pretextbook.org) documents.
- GitHub:
## Documentation and examples for authors/publishers
Most documentation for PreTeXt authors and publishers is available at:
-
Authors and publishers may also find the examples catalog useful as well:
-
We have a few notes below (TODO: publish these in the Guide).
### Installation
#### Installing Python
PreTeXt-CLI requires the Python version specified in `pyproject.toml`.
To check your version, type this into your terminal or command prompt:
```
python -V
```
If your version is 2.x, try this instead
(and if so, either replace all future references to `python`
in these instructions with `python3`).
```
python3 -V
```
If you don't have a compatible Python available, try one of these:
- https://www.python.org/downloads/
- Windows warning: Be sure to select the option adding Python to your Path.
- https://github.com/pyenv/pyenv#installation (Mac/Linux)
- https://github.com/pyenv-win/pyenv-win#installation (Windows)
#### Installing PreTeXt-CLI
Once you've confirmed that you're using a valid version of Python, just
run (replacing `python` with `python3` if necessary):
```
python -m pip install --user pretextbook
```
(It's also possible you may get an error like
`error: invalid command 'bdist_wheel'`
— good news, you can ignore it!)
After installation, try to run:
```
pretext --help
```
If that works, great! Otherwise, it likely means that Python packages
aren't available on your “PATH”. In that case, replace all `pretext`
commands with `python -m pretext` instead:
```
python -m pretext --help
```
Either way, you're now ready to use the CLI, the `--help` option will explain how to use all the different
subcommands like `pretext new` and `pretext build`.
#### External dependencies
We install as much as we can with the `pip install` command, but depending on your machine
you may require some extra software:
- [TeXLive](https://www.tug.org/texlive/)
- [pdftoppm/Ghostscript](https://github.com/abarker/pdfCropMargins/blob/master/doc/installing_pdftoppm_and_ghostscript.rst)
#### Upgrading PreTeXt-CLI
If you have an existing installation and you want to upgrade to a more recent version, you can run:
```
python -m pip install --upgrade pretextbook
```
#### Custom XSL
Custom XSL is not encouraged for most authors, but (for example) developers working
bleeding-edge XSL from core PreTeXt may want to call XSL different from that
which is shipped with a fixed version of the CLI. This may be accomplished by
adding an `` element to your target with a relative (to `project.ptx`) or
absolute path to the desired XSL. *(Note: this XSL must only import
other XSL files in the same directory or within subdirectories.)*
For example:
```
htmlsource/main.ptxpublication/publication.ptxoutput/html../pretext/xsl/pretext-html.xsl
```
If your custom XSL file needs to import the XSL
shipped with the CLI (e.g. `pretext-common.xsl`), then use a `./core/`
prefix in your custom XSL's `xsl:import@href` as follows:
```
```
Similarly, `entities.ent` may be used:
```
%entities;
]>
```
%package help
Summary: Development documents and examples for pretextbook
Provides: python3-pretextbook-doc
%description help
# PreTeXt-CLI
A package for authoring and building [PreTeXt](https://pretextbook.org) documents.
- GitHub:
## Documentation and examples for authors/publishers
Most documentation for PreTeXt authors and publishers is available at:
-
Authors and publishers may also find the examples catalog useful as well:
-
We have a few notes below (TODO: publish these in the Guide).
### Installation
#### Installing Python
PreTeXt-CLI requires the Python version specified in `pyproject.toml`.
To check your version, type this into your terminal or command prompt:
```
python -V
```
If your version is 2.x, try this instead
(and if so, either replace all future references to `python`
in these instructions with `python3`).
```
python3 -V
```
If you don't have a compatible Python available, try one of these:
- https://www.python.org/downloads/
- Windows warning: Be sure to select the option adding Python to your Path.
- https://github.com/pyenv/pyenv#installation (Mac/Linux)
- https://github.com/pyenv-win/pyenv-win#installation (Windows)
#### Installing PreTeXt-CLI
Once you've confirmed that you're using a valid version of Python, just
run (replacing `python` with `python3` if necessary):
```
python -m pip install --user pretextbook
```
(It's also possible you may get an error like
`error: invalid command 'bdist_wheel'`
— good news, you can ignore it!)
After installation, try to run:
```
pretext --help
```
If that works, great! Otherwise, it likely means that Python packages
aren't available on your “PATH”. In that case, replace all `pretext`
commands with `python -m pretext` instead:
```
python -m pretext --help
```
Either way, you're now ready to use the CLI, the `--help` option will explain how to use all the different
subcommands like `pretext new` and `pretext build`.
#### External dependencies
We install as much as we can with the `pip install` command, but depending on your machine
you may require some extra software:
- [TeXLive](https://www.tug.org/texlive/)
- [pdftoppm/Ghostscript](https://github.com/abarker/pdfCropMargins/blob/master/doc/installing_pdftoppm_and_ghostscript.rst)
#### Upgrading PreTeXt-CLI
If you have an existing installation and you want to upgrade to a more recent version, you can run:
```
python -m pip install --upgrade pretextbook
```
#### Custom XSL
Custom XSL is not encouraged for most authors, but (for example) developers working
bleeding-edge XSL from core PreTeXt may want to call XSL different from that
which is shipped with a fixed version of the CLI. This may be accomplished by
adding an `` element to your target with a relative (to `project.ptx`) or
absolute path to the desired XSL. *(Note: this XSL must only import
other XSL files in the same directory or within subdirectories.)*
For example:
```
htmlsource/main.ptxpublication/publication.ptxoutput/html../pretext/xsl/pretext-html.xsl
```
If your custom XSL file needs to import the XSL
shipped with the CLI (e.g. `pretext-common.xsl`), then use a `./core/`
prefix in your custom XSL's `xsl:import@href` as follows:
```
```
Similarly, `entities.ent` may be used:
```
%entities;
]>
```
%prep
%autosetup -n pretextbook-0.8.3
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-pretextbook -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue May 30 2023 Python_Bot - 0.8.3-1
- Package Spec generated