1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

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

This commit is contained in:
Ross McFarland
2019-09-30 10:17:50 -07:00
parent f7424a2853
commit a1d2217604
2 changed files with 37 additions and 3 deletions

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).

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(),