Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item IDs absent from rendered HTML #139

Open
opn opened this issue Mar 8, 2018 · 3 comments
Open

Item IDs absent from rendered HTML #139

opn opened this issue Mar 8, 2018 · 3 comments

Comments

@opn
Copy link

opn commented Mar 8, 2018

Testing with curl I find that the HTML returned from routes ending in .html do not have ids on the paragraph divs returned. This seems to be added by the javascript.

Would be good to add these to the vanilla markup so that programmes can fetch specific portions if rendered html.

@WardCunningham
Copy link
Member

Good idea. Should be easy. But the server-side rendering into html is only for a few item types intended to be read by robots. The rendering could be easily duplicated by a consumer from the json data.

render = (page) ->
return f.div({class: "twins"}, f.p('')) + '\n' +
f.div({class: "header"}, f.h1(
f.a({href: '/', style: 'text-decoration: none'},
f.img({height: '32px', src: '/favicon.png'})) +
' ' + (page.title))) + '\n' +
f.div {class: "story"},
page.story.map((story) ->
if story.type is 'paragraph'
f.div {class: "item paragraph"}, f.p(resolveClient.resolveLinks(story.text))
else if story.type is 'image'
f.div {class: "item image"},
f.img({class: "thumbnail", src: story.url}),
f.p(resolveClient.resolveLinks(story.text or story.caption or 'uploaded image'))
else if story.type is 'html'
f.div {class: "item html"},
f.p(resolveClient.resolveLinks(story.text or '', sanitize))
else f.div {class: "item"}, f.p(resolveClient.resolveLinks(story.text or ''))
).join('\n')

It might be interesting to build a "rendering proxy" that would run client plugins server-side for any lineup url including those that span multiple sites. Working out verses of the 99 Bottles of Beer song would be a good test case.

@WardCunningham
Copy link
Member

Speaking of rendering, github has done a nice job of expanding my code reference into a code window. I wonder how that comes out in watch list email? They don't send me a copy but maybe someone else can tell us how hard they try to match the rendering they do online.

For comparison, here is a screen shot of what I am seeing from me in the comment stream.

image

@paul90
Copy link
Member

paul90 commented Mar 8, 2018

They don't try very hard...

screen shot 2018-03-08 at 16 01 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants