ophinode 0.0.1a6__py3-none-any.whl → 0.0.1a7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ophinode/site.py CHANGED
@@ -35,12 +35,7 @@ class Site:
35
35
  if not isinstance(pages, collections.abc.Iterable):
36
36
  raise TypeError("pages must be an iterable")
37
37
  for path, page in pages:
38
- if not isinstance(path, str):
39
- raise ValueError("path to a page must be a str")
40
- if path in self._pages_dict:
41
- raise ValueError("duplicate page path: " + path)
42
- self._pages_dict[path] = page
43
- self._pages.append((path, page))
38
+ self.add_page(path, page)
44
39
 
45
40
  self._preprocessors_before_site_build = []
46
41
  self._postprocessors_after_site_build = []
@@ -149,6 +144,14 @@ class Site:
149
144
  AUTO_EXPORT_FILES_OPTION_DEFAULT_VALUE
150
145
  )
151
146
 
147
+ def add_page(self, path: str, page: Any):
148
+ if not isinstance(path, str):
149
+ raise TypeError("path to a page must be a str")
150
+ if path in self._pages_dict:
151
+ raise ValueError("duplicate page path: " + path)
152
+ self._pages_dict[path] = page
153
+ self._pages.append((path, page))
154
+
152
155
  def add_processor(
153
156
  self,
154
157
  stage: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ophinode
3
- Version: 0.0.1a6
3
+ Version: 0.0.1a7
4
4
  Summary: A static site generator written in Python
5
5
  Project-URL: Homepage, https://github.com/deflatedlatte/ophinode
6
6
  Project-URL: Issues, https://github.com/deflatedlatte/ophinode/issues
@@ -3,11 +3,11 @@ ophinode/__main__.py,sha256=6i8Wu5lNm8FAaM1xNy46spy_laDdKmo2CmZVYYq4a-c,2210
3
3
  ophinode/constants.py,sha256=LHb4GrAVun3gO-e1jMMvvK2BN0aZ33kEandqzzEQYzk,592
4
4
  ophinode/exceptions.py,sha256=0T4Kuuy4aHa6jRCrIvNSomVCTf1JfECC_kwQzG-iIhk,351
5
5
  ophinode/rendering.py,sha256=Q1cxSwXs22Cq40fvbQVhGk3XQQOy1PcZBObSYt7NduQ,6201
6
- ophinode/site.py,sha256=8E1l9iJ5dj4ksP8YYVnd5Mrf6mYjQ9aMM2XVy3fq64k,16775
6
+ ophinode/site.py,sha256=vIoZoXnAvhYspyVQH4tRJ1edXyRlt95bhqjLrcH870U,16815
7
7
  ophinode/nodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  ophinode/nodes/base.py,sha256=SbjN8wjR77G3_8Lvvog4PriTq4v1WnnNr3nzAi0xMto,1004
9
9
  ophinode/nodes/html.py,sha256=FEnkFcjqD438hRsZWDMwSrkBrwP8C0wDvqsu-a111Jo,25132
10
- ophinode-0.0.1a6.dist-info/METADATA,sha256=OvUl-GWUhHm_VBSyJnihDgWOeEyy1wQMMmrJ66FOFFw,2409
11
- ophinode-0.0.1a6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
- ophinode-0.0.1a6.dist-info/licenses/LICENSE,sha256=bPdztUVhioHPZ6OKqBycopwMfGNB5BwVfRHV68sQoVU,1070
13
- ophinode-0.0.1a6.dist-info/RECORD,,
10
+ ophinode-0.0.1a7.dist-info/METADATA,sha256=T17nwuMzyJx2lqzVInpqhdq5sR2yb2Sa1kzZzOst8WE,2409
11
+ ophinode-0.0.1a7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ ophinode-0.0.1a7.dist-info/licenses/LICENSE,sha256=bPdztUVhioHPZ6OKqBycopwMfGNB5BwVfRHV68sQoVU,1070
13
+ ophinode-0.0.1a7.dist-info/RECORD,,