Skip to content

Commit 11e9454

Browse files
authored
Merge pull request #22 from sphinx-notes/bugfix/indent
schema: Try fix indent problem
2 parents 6c0b857 + eb0ec98 commit 11e9454

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"template": "https://github.com/sphinx-notes/template",
3-
"commit": "c781308dbd84e739727ce09aaf798444ced1e7e4",
4-
"checkout": null,
3+
"commit": "b5c09eed87ca2af4de47c15755f32c3224bffbc5",
4+
"checkout": "docs/any-dog-food",
55
"context": {
66
"cookiecutter": {
77
"namespace": "sphinxnotes",

docs/conf.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,7 @@
7474

7575
# -- Extensions -------------------------------------------------------------
7676

77-
extensions.append('sphinxnotes.any')
78-
from sphinxnotes.any import Schema, Field as F
79-
any_schemas = [
80-
#
81-
Schema('version',
82-
name=F(unique=True, referenceable=True, required=True, form=F.Form.LINES),
83-
attrs={'date': F(referenceable=True)},
84-
content=F(form=F.Form.LINES),
85-
description_template=open('_templates/version.rst', 'r').read(),
86-
reference_template='💽 {{ title }}',
87-
missing_reference_template='💽 {{ title }}',
88-
ambiguous_reference_template='💽 {{ title }}'),
89-
#
90-
]
91-
primary_domain = 'any'
77+
#
9278

9379
extensions.append('sphinx.ext.extlinks')
9480
extlinks = {
@@ -120,11 +106,9 @@
120106
extensions.append('any')
121107

122108
# DOG FOOD CONFIGURATION START
123-
124-
# Override
125-
extensions.remove('sphinxnotes.any')
126109
from any import Schema, Field as F
127110
sys.path.insert(0, os.path.abspath('.'))
111+
128112
any_schemas = [
129113
Schema('version',
130114
name=F(unique=True, referenceable=True, required=True, form=F.Form.LINES),
@@ -141,4 +125,5 @@
141125
__import__("_schemas.tmplvar").tmplvar.tmplvar,
142126
]
143127

128+
primary_domain = 'any'
144129
# DOG FOOD CONFIGURATION END

src/sphinxnotes/any/schema.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def _as_words(self, rawval:str) -> List[str]:
9999
def _as_lines(self, rawval:str) -> List[str]:
100100
assert self.form == self.Form.LINES
101101
assert rawval is not None
102-
return [x.strip() for x in rawval.split('\n') if x.strip() != '']
102+
return rawval.split('\n')
103+
103104

104105

105106
def value_of(self, rawval:Optional[str]) -> Union[None,str,List[str]]:

0 commit comments

Comments
 (0)