%global _empty_manifest_terminate_build 0 Name: python-prettierfier Version: 1.0.3 Release: 1 Summary: Intelligently pretty-print HTML/XML with inline tags. License: MIT URL: https://github.com/annedo/prettierfier Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3a/80/c1bb6cb21ef8a7b228394c8fdadec6c064074852c3374a4204285d9e3f11/prettierfier-1.0.3.tar.gz BuildArch: noarch %description # prettierfier While I love [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) as a parser, `BeautifulSoup.prettify()` adds a linebreak between *every* tag. This results in unwanted white space between tags that should be inline, like ``, ``, ``, etc: ```

Introducing GitHub®

```

Introducing GitHub®

vs. ```

Introducing GitHub ®

```

Introducing GitHub ®

This module parses HTML/XML as a raw string to more intelligently format tags. ## Installation You have two options: 1. `pip install prettierfier` in your command line 2. Copy the contents of [prettierfier.py](prettierfier.py) to your own module. This module is built with just the Python Standard Library and contains no external third-party dependencies. ## Functions **prettify_xml**(*xml_string, indent=2, debug=False*) * Can be used with no prior formatting. ``` Args: xml_string (str): XML text to prettify. indent (int, optional): Set size of XML tag indents. Test-only args: debug (bool, optional): Show results of each regexp application. Returns: str: Prettified XML. ``` **prettify_html**(*html_string, debug=False*) * Originally created to process `BeautifulSoup.prettify()` output. * Does not add or remove regular line breaks. Can be used with regular HTML if it already has the newlines you want to keep. ``` Args: html_string (str): HTML string to parse. Test-only args: debug (bool, optional): Show results of each regexp application. Returns: str: Prettified HTML. ``` ## Example ``` import prettierfier ugly_html = """

Introducing GitHub ®

""" pretty_html = prettierfier.prettify_html(ugly_html) print(pretty_html) # Output >>>

Introducing GitHub®

``` ### Links * [GitHub](https://github.com/annedo/prettierfier) * [PyPi](https://pypi.org/project/prettierfier/) %package -n python3-prettierfier Summary: Intelligently pretty-print HTML/XML with inline tags. Provides: python-prettierfier BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-prettierfier # prettierfier While I love [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) as a parser, `BeautifulSoup.prettify()` adds a linebreak between *every* tag. This results in unwanted white space between tags that should be inline, like ``, `
`, ``, etc: ```

Introducing GitHub®

```

Introducing GitHub®

vs. ```

Introducing GitHub ®

```

Introducing GitHub ®

This module parses HTML/XML as a raw string to more intelligently format tags. ## Installation You have two options: 1. `pip install prettierfier` in your command line 2. Copy the contents of [prettierfier.py](prettierfier.py) to your own module. This module is built with just the Python Standard Library and contains no external third-party dependencies. ## Functions **prettify_xml**(*xml_string, indent=2, debug=False*) * Can be used with no prior formatting. ``` Args: xml_string (str): XML text to prettify. indent (int, optional): Set size of XML tag indents. Test-only args: debug (bool, optional): Show results of each regexp application. Returns: str: Prettified XML. ``` **prettify_html**(*html_string, debug=False*) * Originally created to process `BeautifulSoup.prettify()` output. * Does not add or remove regular line breaks. Can be used with regular HTML if it already has the newlines you want to keep. ``` Args: html_string (str): HTML string to parse. Test-only args: debug (bool, optional): Show results of each regexp application. Returns: str: Prettified HTML. ``` ## Example ``` import prettierfier ugly_html = """

Introducing GitHub ®

""" pretty_html = prettierfier.prettify_html(ugly_html) print(pretty_html) # Output >>>

Introducing GitHub®

``` ### Links * [GitHub](https://github.com/annedo/prettierfier) * [PyPi](https://pypi.org/project/prettierfier/) %package help Summary: Development documents and examples for prettierfier Provides: python3-prettierfier-doc %description help # prettierfier While I love [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) as a parser, `BeautifulSoup.prettify()` adds a linebreak between *every* tag. This results in unwanted white space between tags that should be inline, like ``, `
`, ``, etc: ```

Introducing GitHub®

```

Introducing GitHub®

vs. ```

Introducing GitHub ®

```

Introducing GitHub ®

This module parses HTML/XML as a raw string to more intelligently format tags. ## Installation You have two options: 1. `pip install prettierfier` in your command line 2. Copy the contents of [prettierfier.py](prettierfier.py) to your own module. This module is built with just the Python Standard Library and contains no external third-party dependencies. ## Functions **prettify_xml**(*xml_string, indent=2, debug=False*) * Can be used with no prior formatting. ``` Args: xml_string (str): XML text to prettify. indent (int, optional): Set size of XML tag indents. Test-only args: debug (bool, optional): Show results of each regexp application. Returns: str: Prettified XML. ``` **prettify_html**(*html_string, debug=False*) * Originally created to process `BeautifulSoup.prettify()` output. * Does not add or remove regular line breaks. Can be used with regular HTML if it already has the newlines you want to keep. ``` Args: html_string (str): HTML string to parse. Test-only args: debug (bool, optional): Show results of each regexp application. Returns: str: Prettified HTML. ``` ## Example ``` import prettierfier ugly_html = """

Introducing GitHub ®

""" pretty_html = prettierfier.prettify_html(ugly_html) print(pretty_html) # Output >>>

Introducing GitHub®

``` ### Links * [GitHub](https://github.com/annedo/prettierfier) * [PyPi](https://pypi.org/project/prettierfier/) %prep %autosetup -n prettierfier-1.0.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-prettierfier -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Apr 25 2023 Python_Bot - 1.0.3-1 - Package Spec generated