Browse Source

Fix/hack README rendering so that pypi's markdown handling libs are happy

pull/408/head
Ross McFarland 6 years ago
parent
commit
a1d2217604
No known key found for this signature in database GPG Key ID: 61C10C4FC8FE4A89
2 changed files with 37 additions and 3 deletions
  1. +2
    -2
      README.md
  2. +35
    -1
      setup.py

+ 2
- 2
README.md View File

@ -90,8 +90,8 @@ Now that we have something to tell OctoDNS about our providers & zones we need t
ttl: 60
type: A
values:
- 1.2.3.4
- 1.2.3.5
- 1.2.3.4
- 1.2.3.5
```
Further information can be found in [Records Documentation](/docs/records.md).


+ 35
- 1
setup.py View File

@ -1,5 +1,6 @@
#!/usr/bin/env python
from StringIO import StringIO
from os.path import dirname, join
import octodns
@ -21,6 +22,39 @@ console_scripts = {
for name in cmds
}
def long_description():
buf = StringIO()
yaml_block = False
supported_providers = False
with open('README.md') as fh:
for line in fh:
if line == '```yaml\n':
yaml_block = True
continue
elif yaml_block and line == '---\n':
# skip the line
continue
elif yaml_block and line == '```\n':
yaml_block = False
continue
elif supported_providers:
if line.startswith('## '):
supported_providers = False
# write this line out, no continue
else:
# We're ignoring this one
continue
elif line == '## Supported providers\n':
supported_providers = True
continue
buf.write(line)
buf = buf.getvalue()
with open('/tmp/mod', 'w') as fh:
fh.write(buf)
return buf
setup(
author='Ross McFarland',
author_email='rwmcfa1@gmail.com',
@ -40,7 +74,7 @@ setup(
'requests>=2.20.0'
],
license='MIT',
long_description=open('README.md').read(),
long_description=long_description(),
long_description_content_type='text/markdown',
name='octodns',
packages=find_packages(),


Loading…
Cancel
Save