1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Merge pull request #1916 from yosmoc/configuable_plantuml_server

Configurable plantuml server
This commit is contained in:
Junyoung Choi (Sai)
2018-05-15 20:02:11 +09:00
committed by GitHub
17 changed files with 32 additions and 1 deletions

View File

@@ -145,11 +145,13 @@ class Markdown {
const deflate = require('markdown-it-plantuml/lib/deflate')
this.md.use(require('markdown-it-plantuml'), '', {
generateSource: function (umlCode) {
const stripTrailingSlash = (url) => url.endsWith('/') ? url.slice(0, -1) : url
const serverAddress = stripTrailingSlash(config.preview.plantUMLServerAddress) + '/svg'
const s = unescape(encodeURIComponent(umlCode))
const zippedCode = deflate.encode64(
deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9)
)
return `http://www.plantuml.com/plantuml/svg/${zippedCode}`
return `${serverAddress}/${zippedCode}`
}
})

View File

@@ -53,6 +53,7 @@ export const DEFAULT_CONFIG = {
latexInlineClose: '$',
latexBlockOpen: '$$',
latexBlockClose: '$$',
plantUMLServerAddress: 'http://www.plantuml.com/plantuml',
scrollPastEnd: false,
smartQuotes: true,
sanitize: 'STRICT' // 'STRICT', 'ALLOW_STYLES', 'NONE'

View File

@@ -94,6 +94,7 @@ class UiTab extends React.Component {
latexInlineClose: this.refs.previewLatexInlineClose.value,
latexBlockOpen: this.refs.previewLatexBlockOpen.value,
latexBlockClose: this.refs.previewLatexBlockClose.value,
plantUMLServerAddress: this.refs.previewPlantUMLServerAddress.value,
scrollPastEnd: this.refs.previewScrollPastEnd.checked,
smartQuotes: this.refs.previewSmartQuotes.checked,
sanitize: this.refs.previewSanitize.value
@@ -544,6 +545,19 @@ class UiTab extends React.Component {
/>
</div>
</div>
<div styleName='group-section'>
<div styleName='group-section-label'>
{i18n.__('PlantUML Server')}
</div>
<div styleName='group-section-control'>
<input styleName='group-section-control-input'
ref='previewPlantUMLServerAddress'
value={config.preview.plantUMLServerAddress}
onChange={(e) => this.handleUIChange(e)}
type='text'
/>
</div>
</div>
<div styleName='group-control'>
<button styleName='group-control-rightButton'

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
"PlantUML Server": "PlantUML Server",
"Community": "Community",
"Subscribe to Newsletter": "Subscribe to Newsletter",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Ende Kennzeichen",
"LaTeX Block Open Delimiter": "LaTeX Block Beginn Kennzeichen",
"LaTeX Block Close Delimiter": "LaTeX Block Ende Kennzeichen",
"PlantUML Server": "PlantUML Server",
"Community": "Community",
"Subscribe to Newsletter": "Newsletter abonnieren",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
"PlantUML Server": "PlantUML Server",
"Community": "Community",
"Subscribe to Newsletter": "Subscribe to Newsletter",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "Delimitador de cierre LaTeX en línea",
"LaTeX Block Open Delimiter": "Delimitado de apertura bloque LaTeX",
"LaTeX Block Close Delimiter": "Delimitador de cierre bloque LaTeX",
"PlantUML Server": "PlantUML Server",
"Community": "Comunidad",
"Subscribe to Newsletter": "Suscribirse al boletín",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "جداکننده پایانی لاتکس خطی",
"LaTeX Block Open Delimiter": "جداکننده آغازین بلوک لاتکس ",
"LaTeX Block Close Delimiter": "جداکننده آغازین بلوک لاتکس ",
"PlantUML Server": "PlantUML Server",
"Community": "کامینیتی",
"Subscribe to Newsletter": "اشتراک در خبرنامه",
"GitHub": "گیت هاب",

View File

@@ -61,6 +61,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
"PlantUML Server": "PlantUML Server",
"Community": "Communauté",
"Subscribe to Newsletter": "Souscrire à la newsletter",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Záró Határolója",
"LaTeX Block Open Delimiter": "LaTeX Blokk Nyitó Határolója",
"LaTeX Block Close Delimiter": "LaTeX Blokk Záró Határolója",
"PlantUML Server": "PlantUML Server",
"Community": "Közösség",
"Subscribe to Newsletter": "Feliratkozás a Hírlevélre",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "Delimitatore inline per chiusura LaTex",
"LaTeX Block Open Delimiter": "Delimitatore apertura LaTex",
"LaTeX Block Close Delimiter": "Delimitatore chiusura LaTex",
"PlantUML Server": "PlantUML Server",
"Community": "Community",
"Subscribe to Newsletter": "Iscriviti alla Newsletter",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX 終了デリミタ(インライン)",
"LaTeX Block Open Delimiter": "LaTeX 開始デリミタ(ブロック)",
"LaTeX Block Close Delimiter": "LaTeX 終了デリミタ(ブロック)",
"PlantUML Server": "PlantUML サーバー",
"Community": "コミュニティ",
"Subscribe to Newsletter": "ニュースレターを購読する",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX 인라인 블록 닫기 기호",
"LaTeX Block Open Delimiter": "LaTeX 블록 열기 기호",
"LaTeX Block Close Delimiter": "LaTeX 블록 닫기 기호",
"PlantUML Server": "PlantUML Server",
"Community": "커뮤니티",
"Subscribe to Newsletter": "뉴스레터 구독",
"GitHub": "깃허브",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
"PlantUML Server": "PlantUML Server",
"Community": "Community",
"Subscribe to Newsletter": "Subscribe to Newsletter",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
"PlantUML Server": "PlantUML Server",
"Community": "Community",
"Subscribe to Newsletter": "Subscribe to Newsletter",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "Delimitador em Linha Fechado do LaTeX",
"LaTeX Block Open Delimiter": "Delimitador de Bloco Aberto do LaTeX",
"LaTeX Block Close Delimiter": "Delimitador de Bloco Fechado do LaTeX",
"PlantUML Server": "PlantUML Server",
"Community": "Comunidade",
"Subscribe to Newsletter": "Subscrever à Newsletter",
"GitHub": "GitHub",

View File

@@ -62,6 +62,7 @@
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
"PlantUML Server": "PlantUML Server",
"Community": "Community",
"Subscribe to Newsletter": "Subscribe to Newsletter",
"GitHub": "GitHub",