%global _empty_manifest_terminate_build 0
Name: python-wbuilder
Version: 3.0.5
Release: 1
Summary: HTML template generator for Python.
License: MIT
URL: https://github.com/rmaniego/wbuilder
Source0: https://mirrors.aliyun.com/pypi/web/packages/bb/04/4b16f7b6aa229af3d6686ee2f31baab66b13cbbc1f9b8451b919dff8c9fe/wbuilder-3.0.5.tar.gz
BuildArch: noarch
Requires: python3-beautifulsoup4
Requires: python3-html5lib
Requires: python3-namari
%description
# wBuilder
```
wBuilder
(c) 2020 Rodney Maniego Jr.
MIT License
```
HTML template generator for Python.
Read: [Introducing wBuilder: An HTML5 Generator for Python](https://peakd.com/hive-102677/@oniemaniego/introducing-wbuilder-an-html5-generator-for-python)
*Requirements:*
- Arkivist, BS4, Namari
*Future Features*
- Simple JQuery generator
## WebBuilder Usage
**Import**
```python
from wbuilder import WebBuilder
```
**Initialize**
```python
html = WebBuilder()
html = WebBuilder("web.html")
html = WebBuilder(html="")
```
**HTML head**
```python
html.prop("html", "lang", "en")
html.at("head").append("title", text="WebBuilder")
html.at("head").append("meta", charset="UTF-8")
html.at("head").append("meta", name="viewport", content="width=device-width, initial-scale=1, shrink-to-fit=no")
html.at("head").append("link", rel="icon", href="icon.png", type_="image/png", sizes="96x96", static=True)
html.at("head").append("link", rel="stylesheet", href="reset.css", static=True)
html.at("head").append("link", rel="stylesheet", href="design.css")
```
**Basic usage**
```python
html.at("body").append("div", id="#popup .popup")
html.at("#popup").append("header3", id=".header", text="Welcome!")
```
**CSS selectors**
```python
html.at("#popup").append("span", id="#popup-txt .popup-txt", text="Hello, user!")
html.at("#popup").append("button", id="#ok .blue", text="OK")
# CSS as a string
html.inlineCss("div", {"color": "#000"})
html.inlineCss("div", "font-size:12px;", reset=True))
# CSS as a dictionary
design = { "font-size": "12px", "color": "#222", "background-color": "#f0f0f0" }
html.at("#popup").append("div", id=".message", text="Lorem ipsum...", style=design)
```
**Update element properties**
```python
html.prop("html", "lang", "en")
html.prop("#popup", "data-name", "container")
html.prop("#popup", "data-title", "message")
html.prop("div", "style", "font-size:12px;")
```
**Preview HTML**
```python
content = html.build()
print(content)
```
**Save to HTML file**
```python
html.save()
html.save("saveAsNewFile.html")
```
**Save to/Read from JSON file**
```python
html.toJson("test.json")
html.fromJson("test.json")
```
%package -n python3-wbuilder
Summary: HTML template generator for Python.
Provides: python-wbuilder
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-wbuilder
# wBuilder
```
wBuilder
(c) 2020 Rodney Maniego Jr.
MIT License
```
HTML template generator for Python.
Read: [Introducing wBuilder: An HTML5 Generator for Python](https://peakd.com/hive-102677/@oniemaniego/introducing-wbuilder-an-html5-generator-for-python)
*Requirements:*
- Arkivist, BS4, Namari
*Future Features*
- Simple JQuery generator
## WebBuilder Usage
**Import**
```python
from wbuilder import WebBuilder
```
**Initialize**
```python
html = WebBuilder()
html = WebBuilder("web.html")
html = WebBuilder(html="")
```
**HTML head**
```python
html.prop("html", "lang", "en")
html.at("head").append("title", text="WebBuilder")
html.at("head").append("meta", charset="UTF-8")
html.at("head").append("meta", name="viewport", content="width=device-width, initial-scale=1, shrink-to-fit=no")
html.at("head").append("link", rel="icon", href="icon.png", type_="image/png", sizes="96x96", static=True)
html.at("head").append("link", rel="stylesheet", href="reset.css", static=True)
html.at("head").append("link", rel="stylesheet", href="design.css")
```
**Basic usage**
```python
html.at("body").append("div", id="#popup .popup")
html.at("#popup").append("header3", id=".header", text="Welcome!")
```
**CSS selectors**
```python
html.at("#popup").append("span", id="#popup-txt .popup-txt", text="Hello, user!")
html.at("#popup").append("button", id="#ok .blue", text="OK")
# CSS as a string
html.inlineCss("div", {"color": "#000"})
html.inlineCss("div", "font-size:12px;", reset=True))
# CSS as a dictionary
design = { "font-size": "12px", "color": "#222", "background-color": "#f0f0f0" }
html.at("#popup").append("div", id=".message", text="Lorem ipsum...", style=design)
```
**Update element properties**
```python
html.prop("html", "lang", "en")
html.prop("#popup", "data-name", "container")
html.prop("#popup", "data-title", "message")
html.prop("div", "style", "font-size:12px;")
```
**Preview HTML**
```python
content = html.build()
print(content)
```
**Save to HTML file**
```python
html.save()
html.save("saveAsNewFile.html")
```
**Save to/Read from JSON file**
```python
html.toJson("test.json")
html.fromJson("test.json")
```
%package help
Summary: Development documents and examples for wbuilder
Provides: python3-wbuilder-doc
%description help
# wBuilder
```
wBuilder
(c) 2020 Rodney Maniego Jr.
MIT License
```
HTML template generator for Python.
Read: [Introducing wBuilder: An HTML5 Generator for Python](https://peakd.com/hive-102677/@oniemaniego/introducing-wbuilder-an-html5-generator-for-python)
*Requirements:*
- Arkivist, BS4, Namari
*Future Features*
- Simple JQuery generator
## WebBuilder Usage
**Import**
```python
from wbuilder import WebBuilder
```
**Initialize**
```python
html = WebBuilder()
html = WebBuilder("web.html")
html = WebBuilder(html="")
```
**HTML head**
```python
html.prop("html", "lang", "en")
html.at("head").append("title", text="WebBuilder")
html.at("head").append("meta", charset="UTF-8")
html.at("head").append("meta", name="viewport", content="width=device-width, initial-scale=1, shrink-to-fit=no")
html.at("head").append("link", rel="icon", href="icon.png", type_="image/png", sizes="96x96", static=True)
html.at("head").append("link", rel="stylesheet", href="reset.css", static=True)
html.at("head").append("link", rel="stylesheet", href="design.css")
```
**Basic usage**
```python
html.at("body").append("div", id="#popup .popup")
html.at("#popup").append("header3", id=".header", text="Welcome!")
```
**CSS selectors**
```python
html.at("#popup").append("span", id="#popup-txt .popup-txt", text="Hello, user!")
html.at("#popup").append("button", id="#ok .blue", text="OK")
# CSS as a string
html.inlineCss("div", {"color": "#000"})
html.inlineCss("div", "font-size:12px;", reset=True))
# CSS as a dictionary
design = { "font-size": "12px", "color": "#222", "background-color": "#f0f0f0" }
html.at("#popup").append("div", id=".message", text="Lorem ipsum...", style=design)
```
**Update element properties**
```python
html.prop("html", "lang", "en")
html.prop("#popup", "data-name", "container")
html.prop("#popup", "data-title", "message")
html.prop("div", "style", "font-size:12px;")
```
**Preview HTML**
```python
content = html.build()
print(content)
```
**Save to HTML file**
```python
html.save()
html.save("saveAsNewFile.html")
```
**Save to/Read from JSON file**
```python
html.toJson("test.json")
html.fromJson("test.json")
```
%prep
%autosetup -n wbuilder-3.0.5
%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-wbuilder -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Jun 20 2023 Python_Bot - 3.0.5-1
- Package Spec generated