page creation: still no html

master
Castro0o 10 years ago
parent c427d85712
commit 67f844c193

File diff suppressed because one or more lines are too long

@ -49,13 +49,13 @@ def replace_video(content):
return content, videos
def create_workpage( work, work_key, tree): # replace text content in dict with html nodes, holding the content
pprint.pprint( work)
# pprint.pprint( work)
for key in work.keys():
print work[key]
# print work[key]
div_header = (tree.findall(".//div[@class='header']"))[0]
div_body = (tree.findall(".//div[@class='body']"))[0]
div_av = (tree.findall(".//div[@class='av']"))[0]
div_header = tree.find(".//div[@class='header']")
div_body = tree.find(".//div[@class='body']")
div_av = tree.find(".//div[@class='av']")
if key in ['Description', 'Extra']:
mw_content = work[key]
@ -71,20 +71,32 @@ def create_workpage( work, work_key, tree): # replace text content in dict with
iframe_el = ET.SubElement(div_av, 'iframe', attrib={'src': video, 'width':'600px', 'height':'450px'})
print 'VIDEO', ET.tostring(iframe_el)
work[key] = pandoc2html( mw_content if key in work.keys() else '' ) # convert to HTML
text_el = html5lib.parseFragment(work[key], namespaceHTMLElements=False)
text_imgs = text_el.findall('.//img')
if text_imgs:
for img in text_imgs:
print '--------------'
print 'mw_content', mw_content
print '--------------'
x=mw_content
html_content = pandoc2html( x if key in work.keys() else '') # convert to HTML
print 'html_content', html_content
document_el = html5lib.parse(html_content, namespaceHTMLElements=False)#ET.fromstring(html_content)
print ET.tostring(document_el)
print 'document_el', document_el, ET.iselement(document_el)
all_el = document_el.findall('body//')
if all_el:
all_el.reverse()
for el in all_el:
print 'el', ET.tostring(el)
div_body.append(el)
imgs = document_el.findall('.//img')
if imgs:
for img in imgs:
src = api_file_url(img.get('src'))
img.set('src', src)
print 'IMG', img, src
div_body.append( text_el )
# div_body.append( document_el )
# print 'div_body', ET.tostring(div_body)
elif key in ['Thumbnail']:
@ -138,7 +150,7 @@ def create_workpage( work, work_key, tree): # replace text content in dict with
def edit_index(filepath, json_allworks_dict):
input_file = open(filepath, 'r')
tree = html5lib.parse(input_file, namespaceHTMLElements=False)
div_section02 = (tree.findall(".//div[@id='section02']"))[0]
div_section02 = tree.find(".//div[@id='section02']")
for key in json_allworks_dict.keys():
graduation_work=json_allworks_dict[key]
insert_work(div_section02, 'Graduation_work thumbnail', graduation_work, key )
@ -152,7 +164,7 @@ for key in json_allworks.keys():
date = work['Date']
creator = (work['Creator'].encode('ascii', 'ignore')).replace(' ','_')
work_file = 'web/{}-{}-{}.html'.format(date, key, creator)
print work_file
# print work_file
work_tree = html5lib.parse(worktemplate, namespaceHTMLElements=False)
create_workpage(work, key, work_tree )
write_html_file(work_tree, work_file)
@ -161,7 +173,7 @@ for key in json_allworks.keys():
### ISSSUES
# Gallaries, Files, videos, in orginal places correct place
# Specificy positions in template
# rm <DOCUMENT_FRAGMENT> from pandoc output
# insert <p> into <div class="body">
# separate Extra and Description

@ -6,9 +6,9 @@
<body>
<div id="work">
<div class="header"><a href="https://en.wikipedia.org/wiki/Luther_Blissett_%28nom_de_plume%29" id="Website">https://en.wikipedia.org/wiki/Luther_Blissett_%28nom_de_plume%29</a><p id="Bio">Luther Blissett is a multiple-use name, an "open pop star" informally adopted and shared by hundreds of artists and activists all over Europe and the Americas since 1994. The pseudonym first appeared in Bologna, Italy, in mid-1994, when a number of cultural activists began using it for staging a series of urban and media pranks and to experiment with new forms of authorship and identity. From Bologna the multiple-use name spread to other European cities, such as Rome and London, as well as countries such as Germany, Spain, and Slovenia.[1] Sporadic appearances of Luther Blissett have been also noted in Canada, the United States, and Brazil.</p><h1 id="Title">Qq</h1><p id="Creator">Luther Blisset</p><p id="Date">2015</p></div><!--title, Creator, Date, Bio will go here -->
<div class="body"><DOCUMENT_FRAGMENT><p>The novel Q was written by four Bologna-based members of the LBP, as a final contribution to the project, and published in Italy in 1999. So far, it has been translated into English (British and American), Spanish, German, Dutch, French, Portuguese (Brazilian), Danish, Polish, Greek, Czech, Russian, Turkish, Basque and Korean. In August 2003 the book was nominated for the Guardian First Book Prize.</p>
</DOCUMENT_FRAGMENT><DOCUMENT_FRAGMENT><p>While the folk heroes of the early-modern period and the nineteenth century served a variety of social and political purposes, the Luther Blissett Project (LBP) were able to utilize the media and communication strategies unavailable to their predecessors. According to Marco Deseriis, the main purpose of the LBP was to create a folk hero of the information society whereby knowledge workers and immaterial workers could organize and recognize themselves.[5] Thus, rather than being understood only as a media prankster and culture jammer, Luther Blissett became a positive mythic figure that was supposed to embody the very process of community and cross-media storytelling. Roberto Bui—one of the co-founders of the LBP and Wu Ming—explains the function of Luther Blissett and other radical folk heroes as mythmaking or mythopoesis<img alt="Quipu - a hybrid between octopus and rope " src="http://pzwiki.wdka.nl/mw-mediadesign/images/c/cc/Quipu.png" title="fig:Quipu - a hybrid between octopus and rope "><img alt="This is possibly a screen shot" src="http://pzwiki.wdka.nl/mw-mediadesign/images/3/38/Screen_Shot_2015-03-31_at_11.07.35.png" title="fig:This is possibly a screen shot"></p>
</DOCUMENT_FRAGMENT></div> <!-- Description, Extra will go here -->
<div class="body"><p>The novel Q was written by four Bologna-based members of the LBP, as a final contribution to the project, and published in Italy in 1999. So far, it has been translated into English (British and American), Spanish, German, Dutch, French, Portuguese (Brazilian), Danish, Polish, Greek, Czech, Russian, Turkish, Basque and Korean. In August 2003 the book was nominated for the Guardian First Book Prize.</p>
<img alt="This is possibly a screen shot" src="http://pzwiki.wdka.nl/mw-mediadesign/images/3/38/Screen_Shot_2015-03-31_at_11.07.35.png" title="fig:This is possibly a screen shot"><img alt="Quipu - a hybrid between octopus and rope " src="http://pzwiki.wdka.nl/mw-mediadesign/images/c/cc/Quipu.png" title="fig:Quipu - a hybrid between octopus and rope "><p>While the folk heroes of the early-modern period and the nineteenth century served a variety of social and political purposes, the Luther Blissett Project (LBP) were able to utilize the media and communication strategies unavailable to their predecessors. According to Marco Deseriis, the main purpose of the LBP was to create a folk hero of the information society whereby knowledge workers and immaterial workers could organize and recognize themselves.[5] Thus, rather than being understood only as a media prankster and culture jammer, Luther Blissett became a positive mythic figure that was supposed to embody the very process of community and cross-media storytelling. Roberto Bui—one of the co-founders of the LBP and Wu Ming—explains the function of Luther Blissett and other radical folk heroes as mythmaking or mythopoesis<img alt="Quipu - a hybrid between octopus and rope " src="http://pzwiki.wdka.nl/mw-mediadesign/images/c/cc/Quipu.png" title="fig:Quipu - a hybrid between octopus and rope "><img alt="This is possibly a screen shot" src="http://pzwiki.wdka.nl/mw-mediadesign/images/3/38/Screen_Shot_2015-03-31_at_11.07.35.png" title="fig:This is possibly a screen shot"></p>
</div> <!-- Description, Extra will go here -->
<div class="av"><img src="http://pzwiki.wdka.nl/mw-mediadesign/images/8/85/Luther-blissett-300.jpg"><iframe height="450px" src="https://www.youtube.com/embed/WUXsLyX4u3M" width="600px"></iframe><iframe height="450px" src="https://www.youtube.com/embed/fg-IyA0jX6w" width="600px"></iframe></div> <!-- AV material (Thumbanail, gallery, video )will go here-->
</div>

Loading…
Cancel
Save