Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
52d0af19
Commit
52d0af19
authored
Jul 12, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: diagram rendering + post-processor (wip)
parent
5f99b300
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
app.scss
client/themes/default/scss/app.scss
+1
-1
definition.yml
server/modules/rendering/html-diagram/definition.yml
+8
-0
renderer.js
server/modules/rendering/html-diagram/renderer.js
+10
-0
renderer.js
server/modules/rendering/markdown-core/renderer.js
+5
-1
No files found.
client/themes/default/scss/app.scss
View file @
52d0af19
...
...
@@ -581,7 +581,7 @@
}
}
pre
.diagram
{
.diagram
{
margin-top
:
1rem
;
}
...
...
server/modules/rendering/html-diagram/definition.yml
0 → 100644
View file @
52d0af19
key
:
htmlDiagram
title
:
Diagrams Post-Processor
description
:
HTML Processing for diagrams (draw.io)
author
:
requarks.io
icon
:
mdi-chart-multiline
enabledDefault
:
true
dependsOn
:
htmlCore
props
:
{}
server/modules/rendering/html-diagram/renderer.js
0 → 100644
View file @
52d0af19
module
.
exports
=
{
async
init
(
$
,
config
)
{
$
(
`pre.diagram`
).
each
((
idx
,
elm
)
=>
{
$
(
elm
).
children
(
'svg'
).
each
((
sidx
,
svg
)
=>
{
$
(
svg
).
removeAttr
(
'content'
)
})
$
(
elm
).
replaceWith
(
$
(
`<div class="diagram">
${
$
(
elm
).
html
()}
</div>`
))
})
}
}
server/modules/rendering/markdown-core/renderer.js
View file @
52d0af19
...
...
@@ -27,7 +27,11 @@ module.exports = {
typographer
:
this
.
config
.
typographer
,
quotes
:
_
.
get
(
quoteStyles
,
this
.
config
.
quotes
,
quoteStyles
.
English
),
highlight
(
str
,
lang
)
{
return
`<pre><code class="language-
${
lang
}
">
${
_
.
escape
(
str
)}
</code></pre>`
if
(
lang
===
'diagram'
)
{
return
`<pre class="diagram">`
+
Buffer
.
from
(
str
,
'base64'
).
toString
()
+
`</pre>`
}
else
{
return
`<pre><code class="language-
${
lang
}
">
${
_
.
escape
(
str
)}
</code></pre>`
}
}
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment