Skip to content

Static syntax highlighting - issue #93#104

Merged
MartinNowak merged 4 commits intomasterfrom
static-highlight
Jan 26, 2016
Merged

Static syntax highlighting - issue #93#104
MartinNowak merged 4 commits intomasterfrom
static-highlight

Conversation

@s-ludwig
Copy link
Member

Has the drawback of putting more load on the server and network, but that shouldn't be too bad.

@Abscissa
Copy link

Has the drawback of putting more load on the server and network, but that shouldn't be too bad.

I can't imagine it would if it's built with ddox generate-html and served as static files. If anything, it's just be a negligible difference in filesize. Does ddox serve-html re-generate the docs on each request?

@s-ludwig
Copy link
Member Author

Has the drawback of putting more load on the server and network, but that shouldn't be too bad.

I can't imagine it would if it's built with ddox generate-html and served as static files. If anything, it's just be a negligible difference in filesize. Does ddox serve-html re-generate the docs on each request?

There are a lot of additional <span class="xyz"></span> strings in the output, so about 26 bytes per keyword, string, number, identifier etc. For medium sized examples that can easily be a few KBs. Nothing bad, but on a high-load service this can definitely make a difference. ddox serve-html indeed regenerates the pages for each request, which generally should be very fast. It just currently does far more dynamic memory allocations than necessary.

All in all, I'm definitely in favor of this change, but I'll defer this slightly until it has been tested a little more.

@MartinNowak
Copy link
Member

Good idea to get rid of prettify-js.

@s-ludwig s-ludwig mentioned this pull request Jan 25, 2016
@MartinNowak
Copy link
Member

libdparse is at 0.4.0 in the meantime, so might make sense to update before adapting much of the code

@s-ludwig
Copy link
Member Author

Updated to libdparse 0.4.0 and rebased+squashed.

The new code uses libdparse to perform the syntax highlighting on the server side. The prettify library is now dropped.
@s-ludwig
Copy link
Member Author

Hm, strange: https://ddox-test-uploads.herokuapp.com/uploads/104846930
Where does that grid come from...

@s-ludwig
Copy link
Member Author

Nice, one issue already caught! Just the grid is still there: https://ddox-test-uploads.herokuapp.com/uploads/104848883

@s-ludwig
Copy link
Member Author

Okay, seems to have been just a diagnostic tool. Looks good now.

@MartinNowak
Copy link
Member

Let's do it.

MartinNowak added a commit that referenced this pull request Jan 26, 2016
@MartinNowak MartinNowak merged commit e231c74 into master Jan 26, 2016
@MartinNowak MartinNowak deleted the static-highlight branch January 26, 2016 11:38
@MartinNowak
Copy link
Member

Can we tag a new release for this?

@s-ludwig
Copy link
Member Author

s-ludwig commented Feb 6, 2016

v0.13.0 is now listed.

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

Successfully merging this pull request may close these issues.

3 participants

Comments