summaryrefslogtreecommitdiff
path: root/python-autosite.spec
blob: 54ecd376a38269d8578456c42686d12ec293fa42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
%global _empty_manifest_terminate_build 0
Name:		python-AutoSite
Version:	1.3
Release:	1
Summary:	Keep all your website's pages under one template
License:	Public Domain
URL:		https://github.com/dotcomboom/AutoSite
Source0:	https://mirrors.aliyun.com/pypi/web/packages/5e/1e/aedbdf8b12fe09f8b24c5ee86169487cf573bd8e2a9472970f8d804d7050/AutoSite-1.3.tar.gz
BuildArch:	noarch


%description
# AutoSite
AutoSite helps you keep all of your website's pages in the same basic template. Managing a navigation bar, a footer, and even meta/OpenGraph tags across several pages is simple.

### [Try it online on repl.it](https://repl.it/@dotcomboom/AutoSite)
### [PyPI](https://pypi.org/project/AutoSite/)
#### [Github](https://github.com/dotcomboom/AutoSite/)
#### [Unofficial guide](https://autosite.neocities.org)

## Installation
### As a package
You can install AutoSite as a package. You can `cd` to the directory where you're building your site and build with the `autosite` command. It can be installed with the command `pip install autosite` or `pip3 install autosite` depending on your configuration.
### Embedded
[`__init__.py`](https://github.com/dotcomboom/AutoSite/blob/master/AutoSite/__init__.py) can also be run directly like the pre-PyPI AutoSite script. Just paste it into wherever you're working and you can run it from there. You'll need to install the requirements manually, which are in [the requirements.txt file](https://github.com/dotcomboom/AutoSite/blob/master/requirements.txt) with the `pip install -r requirements.txt` or `pip3 install -r requirements.txt` commands (provided that you downloaded or wrote that file to the same directory).

## Usage
0. Run `autosite`. It will create a basic `default.html` template and the `in` and `includes` folders.
1. Edit templates/default.html, filling in with these tags:

           [#content#] - The page's content.
           [#path#] - The relative file path from root.
           [#root#] - Use this to point to the site's root folder.
           
   You can also use any other attributes, like [#title#] or [#description#], provided that you define them in each page as below.
           
2. Add your pages to the "in" folder.
      You can define a title and description, or any other attributes you wish, and tell AutoSite which template to use for the page at the top of the file like so:
           
           <!-- attrib title: Your title -->
           <!-- attrib description: Your description -->
           <!-- attrib template: default -->
           <p>Everything under the above lines will replace [#content#] in template.html.</p>
              
    Put other site files in the "includes" folder. Input pages can be HTML or Markdown files, and use the same attribute syntax.
    
3. Run the script. How long it takes depends on how large your site is. Your pages will be in the "out" folder.

## Conditional text
Many sites have a navigation where if you're on a page, that page's name in the navigation is not a link. AutoSite has a feature that lets you replicate this. Consider the following example:
	
      [path!=index.html]<a href="[#root#]index.html">[/path!=]
          Home
      [path!=index.html]</a>[/path!=]
	
You can also omit the `!` symbol and it will only show if it is that page, like this:

      [path=index.html]<p>[/path=]
          This is the index page.
      [path=index.html]<p>[/path=]
	
Conditional text is not limited to just file paths! Nearly any attribute can be used with conditional text.

However, conditional text still has some issues. You can only have one instance of conditional text per line, it is not nestable, and not multiline either.

%package -n python3-AutoSite
Summary:	Keep all your website's pages under one template
Provides:	python-AutoSite
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-AutoSite
# AutoSite
AutoSite helps you keep all of your website's pages in the same basic template. Managing a navigation bar, a footer, and even meta/OpenGraph tags across several pages is simple.

### [Try it online on repl.it](https://repl.it/@dotcomboom/AutoSite)
### [PyPI](https://pypi.org/project/AutoSite/)
#### [Github](https://github.com/dotcomboom/AutoSite/)
#### [Unofficial guide](https://autosite.neocities.org)

## Installation
### As a package
You can install AutoSite as a package. You can `cd` to the directory where you're building your site and build with the `autosite` command. It can be installed with the command `pip install autosite` or `pip3 install autosite` depending on your configuration.
### Embedded
[`__init__.py`](https://github.com/dotcomboom/AutoSite/blob/master/AutoSite/__init__.py) can also be run directly like the pre-PyPI AutoSite script. Just paste it into wherever you're working and you can run it from there. You'll need to install the requirements manually, which are in [the requirements.txt file](https://github.com/dotcomboom/AutoSite/blob/master/requirements.txt) with the `pip install -r requirements.txt` or `pip3 install -r requirements.txt` commands (provided that you downloaded or wrote that file to the same directory).

## Usage
0. Run `autosite`. It will create a basic `default.html` template and the `in` and `includes` folders.
1. Edit templates/default.html, filling in with these tags:

           [#content#] - The page's content.
           [#path#] - The relative file path from root.
           [#root#] - Use this to point to the site's root folder.
           
   You can also use any other attributes, like [#title#] or [#description#], provided that you define them in each page as below.
           
2. Add your pages to the "in" folder.
      You can define a title and description, or any other attributes you wish, and tell AutoSite which template to use for the page at the top of the file like so:
           
           <!-- attrib title: Your title -->
           <!-- attrib description: Your description -->
           <!-- attrib template: default -->
           <p>Everything under the above lines will replace [#content#] in template.html.</p>
              
    Put other site files in the "includes" folder. Input pages can be HTML or Markdown files, and use the same attribute syntax.
    
3. Run the script. How long it takes depends on how large your site is. Your pages will be in the "out" folder.

## Conditional text
Many sites have a navigation where if you're on a page, that page's name in the navigation is not a link. AutoSite has a feature that lets you replicate this. Consider the following example:
	
      [path!=index.html]<a href="[#root#]index.html">[/path!=]
          Home
      [path!=index.html]</a>[/path!=]
	
You can also omit the `!` symbol and it will only show if it is that page, like this:

      [path=index.html]<p>[/path=]
          This is the index page.
      [path=index.html]<p>[/path=]
	
Conditional text is not limited to just file paths! Nearly any attribute can be used with conditional text.

However, conditional text still has some issues. You can only have one instance of conditional text per line, it is not nestable, and not multiline either.

%package help
Summary:	Development documents and examples for AutoSite
Provides:	python3-AutoSite-doc
%description help
# AutoSite
AutoSite helps you keep all of your website's pages in the same basic template. Managing a navigation bar, a footer, and even meta/OpenGraph tags across several pages is simple.

### [Try it online on repl.it](https://repl.it/@dotcomboom/AutoSite)
### [PyPI](https://pypi.org/project/AutoSite/)
#### [Github](https://github.com/dotcomboom/AutoSite/)
#### [Unofficial guide](https://autosite.neocities.org)

## Installation
### As a package
You can install AutoSite as a package. You can `cd` to the directory where you're building your site and build with the `autosite` command. It can be installed with the command `pip install autosite` or `pip3 install autosite` depending on your configuration.
### Embedded
[`__init__.py`](https://github.com/dotcomboom/AutoSite/blob/master/AutoSite/__init__.py) can also be run directly like the pre-PyPI AutoSite script. Just paste it into wherever you're working and you can run it from there. You'll need to install the requirements manually, which are in [the requirements.txt file](https://github.com/dotcomboom/AutoSite/blob/master/requirements.txt) with the `pip install -r requirements.txt` or `pip3 install -r requirements.txt` commands (provided that you downloaded or wrote that file to the same directory).

## Usage
0. Run `autosite`. It will create a basic `default.html` template and the `in` and `includes` folders.
1. Edit templates/default.html, filling in with these tags:

           [#content#] - The page's content.
           [#path#] - The relative file path from root.
           [#root#] - Use this to point to the site's root folder.
           
   You can also use any other attributes, like [#title#] or [#description#], provided that you define them in each page as below.
           
2. Add your pages to the "in" folder.
      You can define a title and description, or any other attributes you wish, and tell AutoSite which template to use for the page at the top of the file like so:
           
           <!-- attrib title: Your title -->
           <!-- attrib description: Your description -->
           <!-- attrib template: default -->
           <p>Everything under the above lines will replace [#content#] in template.html.</p>
              
    Put other site files in the "includes" folder. Input pages can be HTML or Markdown files, and use the same attribute syntax.
    
3. Run the script. How long it takes depends on how large your site is. Your pages will be in the "out" folder.

## Conditional text
Many sites have a navigation where if you're on a page, that page's name in the navigation is not a link. AutoSite has a feature that lets you replicate this. Consider the following example:
	
      [path!=index.html]<a href="[#root#]index.html">[/path!=]
          Home
      [path!=index.html]</a>[/path!=]
	
You can also omit the `!` symbol and it will only show if it is that page, like this:

      [path=index.html]<p>[/path=]
          This is the index page.
      [path=index.html]<p>[/path=]
	
Conditional text is not limited to just file paths! Nearly any attribute can be used with conditional text.

However, conditional text still has some issues. You can only have one instance of conditional text per line, it is not nestable, and not multiline either.

%prep
%autosetup -n AutoSite-1.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-AutoSite -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3-1
- Package Spec generated