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:
@@ -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).
|
||||
|
||||
36
setup.py
36
setup.py
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user