diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-texsoup.spec | 369 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 371 insertions, 0 deletions
@@ -0,0 +1 @@ +/TexSoup-0.3.1.tar.gz diff --git a/python-texsoup.spec b/python-texsoup.spec new file mode 100644 index 0000000..3aae01e --- /dev/null +++ b/python-texsoup.spec @@ -0,0 +1,369 @@ +%global _empty_manifest_terminate_build 0 +Name: python-TexSoup +Version: 0.3.1 +Release: 1 +Summary: parses valid LaTeX and provides variety of Beautiful-Soup-esque methods and Pythonic idioms for iterating over and searching the parse tree +License: BSD +URL: https://github.com/alvinwan/TexSoup +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/84/58/1c503390ed1a81cdcbff811dbf7a54132994acef8dd2194d55cf657a9e97/TexSoup-0.3.1.tar.gz +BuildArch: noarch + + +%description +<a href="https://texsoup.alvinwan.com"><img src="https://user-images.githubusercontent.com/2068077/55692228-b7f92d00-595a-11e9-93a2-90090a361d12.png" width="80px"></a> + +# [TexSoup](https://texsoup.alvinwan.com) + +[](https://pypi.python.org/pypi/TexSoup/) +[](https://travis-ci.org/alvinwan/TexSoup) +[](https://coveralls.io/github/alvinwan/TexSoup?branch=master) + +TexSoup is a fault-tolerant, Python3 package for searching, navigating, and modifying LaTeX documents. + +- [Getting Started](https://github.com/alvinwan/TexSoup#Getting-Started) +- [Installation](https://github.com/alvinwan/TexSoup#Installation) +- [API Reference](http://texsoup.alvinwan.com/docs/data.html) + +Created by [Alvin Wan](http://alvinwan.com) + [contributors](https://github.com/alvinwan/TexSoup/graphs/contributors). + +# Getting Started + +To parse a $LaTeX$ document, pass an open filehandle or a string into the +`TexSoup` constructor. + +``` python +from TexSoup import TexSoup +soup = TexSoup(""" +\begin{document} + +\section{Hello \textit{world}.} + +\subsection{Watermelon} + +(n.) A sacred fruit. Also known as: + +\begin{itemize} +\item red lemon +\item life +\end{itemize} + +Here is the prevalence of each synonym. + +\begin{tabular}{c c} +red lemon & uncommon \\ +life & common +\end{tabular} + +\end{document} +""") +``` + +With the soupified $\LaTeX$, you can now search and traverse the document tree. +The code below demonstrates the basic functions that TexSoup provides. + +```python +>>> soup.section # grabs the first `section` +\section{Hello \textit{world}.} +>>> soup.section.name +'section' +>>> soup.section.string +'Hello \\textit{world}.' +>>> soup.section.parent.name +'document' +>>> soup.tabular +\begin{tabular}{c c} +red lemon & uncommon \\ +life & common +\end{tabular} +>>> soup.tabular.args[0] +'c c' +>>> soup.item +\item red lemon +>>> list(soup.find_all('item')) +[\item red lemon, \item life] +``` + +For more use cases, see [the Quickstart Guide](https://texsoup.alvinwan.com/docs/quickstart.html). Or, try TexSoup [online, via repl.it →](https://repl.it/@ALVINWAN1/texsoup) + +Links: + +- [Quickstart Guide: how and when to use TexSoup](http://texsoup.alvinwan.com/docs/quickstart.html) +- [Example Use Cases: counting references, resolving imports, and more](https://github.com/alvinwan/TexSoup/tree/master/examples) + +# Installation + +## Pip + +TexSoup is published via PyPi, so you can install it via `pip`. The package +name is `TexSoup`: + +```bash +$ pip install texsoup +``` + +## From source + +Alternatively, you can install the package from source: + +```bash +$ git clone https://github.com/alvinwan/TexSoup.git +$ cd TexSoup +$ pip install . +``` + +%package -n python3-TexSoup +Summary: parses valid LaTeX and provides variety of Beautiful-Soup-esque methods and Pythonic idioms for iterating over and searching the parse tree +Provides: python-TexSoup +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-TexSoup +<a href="https://texsoup.alvinwan.com"><img src="https://user-images.githubusercontent.com/2068077/55692228-b7f92d00-595a-11e9-93a2-90090a361d12.png" width="80px"></a> + +# [TexSoup](https://texsoup.alvinwan.com) + +[](https://pypi.python.org/pypi/TexSoup/) +[](https://travis-ci.org/alvinwan/TexSoup) +[](https://coveralls.io/github/alvinwan/TexSoup?branch=master) + +TexSoup is a fault-tolerant, Python3 package for searching, navigating, and modifying LaTeX documents. + +- [Getting Started](https://github.com/alvinwan/TexSoup#Getting-Started) +- [Installation](https://github.com/alvinwan/TexSoup#Installation) +- [API Reference](http://texsoup.alvinwan.com/docs/data.html) + +Created by [Alvin Wan](http://alvinwan.com) + [contributors](https://github.com/alvinwan/TexSoup/graphs/contributors). + +# Getting Started + +To parse a $LaTeX$ document, pass an open filehandle or a string into the +`TexSoup` constructor. + +``` python +from TexSoup import TexSoup +soup = TexSoup(""" +\begin{document} + +\section{Hello \textit{world}.} + +\subsection{Watermelon} + +(n.) A sacred fruit. Also known as: + +\begin{itemize} +\item red lemon +\item life +\end{itemize} + +Here is the prevalence of each synonym. + +\begin{tabular}{c c} +red lemon & uncommon \\ +life & common +\end{tabular} + +\end{document} +""") +``` + +With the soupified $\LaTeX$, you can now search and traverse the document tree. +The code below demonstrates the basic functions that TexSoup provides. + +```python +>>> soup.section # grabs the first `section` +\section{Hello \textit{world}.} +>>> soup.section.name +'section' +>>> soup.section.string +'Hello \\textit{world}.' +>>> soup.section.parent.name +'document' +>>> soup.tabular +\begin{tabular}{c c} +red lemon & uncommon \\ +life & common +\end{tabular} +>>> soup.tabular.args[0] +'c c' +>>> soup.item +\item red lemon +>>> list(soup.find_all('item')) +[\item red lemon, \item life] +``` + +For more use cases, see [the Quickstart Guide](https://texsoup.alvinwan.com/docs/quickstart.html). Or, try TexSoup [online, via repl.it →](https://repl.it/@ALVINWAN1/texsoup) + +Links: + +- [Quickstart Guide: how and when to use TexSoup](http://texsoup.alvinwan.com/docs/quickstart.html) +- [Example Use Cases: counting references, resolving imports, and more](https://github.com/alvinwan/TexSoup/tree/master/examples) + +# Installation + +## Pip + +TexSoup is published via PyPi, so you can install it via `pip`. The package +name is `TexSoup`: + +```bash +$ pip install texsoup +``` + +## From source + +Alternatively, you can install the package from source: + +```bash +$ git clone https://github.com/alvinwan/TexSoup.git +$ cd TexSoup +$ pip install . +``` + +%package help +Summary: Development documents and examples for TexSoup +Provides: python3-TexSoup-doc +%description help +<a href="https://texsoup.alvinwan.com"><img src="https://user-images.githubusercontent.com/2068077/55692228-b7f92d00-595a-11e9-93a2-90090a361d12.png" width="80px"></a> + +# [TexSoup](https://texsoup.alvinwan.com) + +[](https://pypi.python.org/pypi/TexSoup/) +[](https://travis-ci.org/alvinwan/TexSoup) +[](https://coveralls.io/github/alvinwan/TexSoup?branch=master) + +TexSoup is a fault-tolerant, Python3 package for searching, navigating, and modifying LaTeX documents. + +- [Getting Started](https://github.com/alvinwan/TexSoup#Getting-Started) +- [Installation](https://github.com/alvinwan/TexSoup#Installation) +- [API Reference](http://texsoup.alvinwan.com/docs/data.html) + +Created by [Alvin Wan](http://alvinwan.com) + [contributors](https://github.com/alvinwan/TexSoup/graphs/contributors). + +# Getting Started + +To parse a $LaTeX$ document, pass an open filehandle or a string into the +`TexSoup` constructor. + +``` python +from TexSoup import TexSoup +soup = TexSoup(""" +\begin{document} + +\section{Hello \textit{world}.} + +\subsection{Watermelon} + +(n.) A sacred fruit. Also known as: + +\begin{itemize} +\item red lemon +\item life +\end{itemize} + +Here is the prevalence of each synonym. + +\begin{tabular}{c c} +red lemon & uncommon \\ +life & common +\end{tabular} + +\end{document} +""") +``` + +With the soupified $\LaTeX$, you can now search and traverse the document tree. +The code below demonstrates the basic functions that TexSoup provides. + +```python +>>> soup.section # grabs the first `section` +\section{Hello \textit{world}.} +>>> soup.section.name +'section' +>>> soup.section.string +'Hello \\textit{world}.' +>>> soup.section.parent.name +'document' +>>> soup.tabular +\begin{tabular}{c c} +red lemon & uncommon \\ +life & common +\end{tabular} +>>> soup.tabular.args[0] +'c c' +>>> soup.item +\item red lemon +>>> list(soup.find_all('item')) +[\item red lemon, \item life] +``` + +For more use cases, see [the Quickstart Guide](https://texsoup.alvinwan.com/docs/quickstart.html). Or, try TexSoup [online, via repl.it →](https://repl.it/@ALVINWAN1/texsoup) + +Links: + +- [Quickstart Guide: how and when to use TexSoup](http://texsoup.alvinwan.com/docs/quickstart.html) +- [Example Use Cases: counting references, resolving imports, and more](https://github.com/alvinwan/TexSoup/tree/master/examples) + +# Installation + +## Pip + +TexSoup is published via PyPi, so you can install it via `pip`. The package +name is `TexSoup`: + +```bash +$ pip install texsoup +``` + +## From source + +Alternatively, you can install the package from source: + +```bash +$ git clone https://github.com/alvinwan/TexSoup.git +$ cd TexSoup +$ pip install . +``` + +%prep +%autosetup -n TexSoup-0.3.1 + +%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-TexSoup -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.3.1-1 +- Package Spec generated @@ -0,0 +1 @@ +2130d0ed9648cbe0da1d6d15c6a2ce65 TexSoup-0.3.1.tar.gz |