mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-26 16:57:18 +00:00
fix: cleanup the link generation based on type instead of title (Thanks
to Juan Rocha for the report)
This commit is contained in:
parent
8ebde0540a
commit
bee6edc6a8
1 changed files with 4 additions and 3 deletions
|
@ -67,14 +67,14 @@ def header(adoc=False):
|
||||||
doc = doc + "= MISP galaxy\n"
|
doc = doc + "= MISP galaxy\n"
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
def asciidoc(content=False, adoc=None, t='title',title=''):
|
def asciidoc(content=False, adoc=None, t='title',title='', typename=''):
|
||||||
|
|
||||||
adoc = adoc + "\n"
|
adoc = adoc + "\n"
|
||||||
output = ""
|
output = ""
|
||||||
if t == 'title':
|
if t == 'title':
|
||||||
output = '== ' + content
|
output = '== ' + content
|
||||||
elif t == 'info':
|
elif t == 'info':
|
||||||
output = "\n{}.\n\n{} {} {}{}.json[*this location*] {}.\n".format(content, 'NOTE: ', title, 'is a cluster galaxy available in JSON format at https://github.com/MISP/misp-galaxy/blob/master/clusters/',title.lower(),' The JSON format can be freely reused in your application or automatically enabled in https://www.github.com/MISP/MISP[MISP]')
|
output = "\n{}.\n\n{} {} {}$${}$$.json[*this location*] {}.\n".format(content, 'NOTE: ', title, 'is a cluster galaxy available in JSON format at https://github.com/MISP/misp-galaxy/blob/master/clusters/',typename.lower(),' The JSON format can be freely reused in your application or automatically enabled in https://www.github.com/MISP/MISP[MISP]')
|
||||||
elif t == 'author':
|
elif t == 'author':
|
||||||
output = '\nauthors:: {}\n'.format(' - '.join(content))
|
output = '\nauthors:: {}\n'.format(' - '.join(content))
|
||||||
elif t == 'value':
|
elif t == 'value':
|
||||||
|
@ -102,8 +102,9 @@ for cluster in clusters:
|
||||||
with open(fullPathClusters) as fp:
|
with open(fullPathClusters) as fp:
|
||||||
c = json.load(fp)
|
c = json.load(fp)
|
||||||
title = c['name']
|
title = c['name']
|
||||||
|
typename = c['type']
|
||||||
adoc = asciidoc(content=title, adoc=adoc, t='title')
|
adoc = asciidoc(content=title, adoc=adoc, t='title')
|
||||||
adoc = asciidoc(content=c['description'], adoc=adoc, t='info', title=title)
|
adoc = asciidoc(content=c['description'], adoc=adoc, t='info', title=title, typename = typename)
|
||||||
if 'authors' in c:
|
if 'authors' in c:
|
||||||
adoc = asciidoc(content=c['authors'], adoc=adoc, t='author', title=title)
|
adoc = asciidoc(content=c['authors'], adoc=adoc, t='author', title=title)
|
||||||
for v in c['values']:
|
for v in c['values']:
|
||||||
|
|
Loading…
Reference in a new issue