Soporte de expotación desde menú a Html vía pandoc. Véase commit http://mutabit.com/deltas/repos.fossil/grafoscopio/info/161092f9ca
This commit is contained in:
parent
9e9f65c958
commit
6035c6b3be
@ -196,6 +196,19 @@ GrafoscopioBrowser >> customKeys [
|
||||
key: ((bibliography entries at: index) fields at: 2) value ]]].
|
||||
]
|
||||
|
||||
{ #category : #persistence }
|
||||
GrafoscopioBrowser >> exportAsHtml [
|
||||
"Exports the current tree to HTML, using the same name but different extension (.html)"
|
||||
| markdownFileLocation htmlFileLocation pandoc |
|
||||
markdownFileLocation := ((workingFile parent) / workingFile basenameWithoutExtension) fullName, '.markdown'.
|
||||
htmlFileLocation := ((workingFile parent) / workingFile basenameWithoutExtension) fullName, '.html'.
|
||||
Smalltalk platform name = 'unix'
|
||||
ifTrue: [ pandoc := (FileSystem disk workingDirectory / 'Platform' / 'Linux' / 'Programs' / 'Pandoc' / 'pandoc') fullName ].
|
||||
OSProcess command: 'exec ', pandoc, ' ', markdownFileLocation , ' --standalone -o ' , htmlFileLocation.
|
||||
self customKeys.
|
||||
self inform: 'Archivo exportado como html'.
|
||||
]
|
||||
|
||||
{ #category : #persistence }
|
||||
GrafoscopioBrowser >> exportAsMarkdown: aTree on: locator [
|
||||
|
||||
@ -228,6 +241,7 @@ GrafoscopioBrowser >> installPandoc [
|
||||
linuxSupplies := (FileSystem disk workingDirectory
|
||||
/ 'Platform' / 'Linux' / 'Programs' / 'Pandoc')
|
||||
ensureCreateDirectory.
|
||||
|
||||
]
|
||||
|
||||
{ #category : #persistence }
|
||||
@ -334,8 +348,6 @@ GrafoscopioBrowser >> saveWorkingTree [
|
||||
"Saves the current tree to the user predefined file location used when he/she opened it."
|
||||
|
||||
| fileStream markdownFile |
|
||||
|
||||
|
||||
fileStream := workingFile writeStream.
|
||||
markdownFile := (workingFile parent) / (workingFile basenameWithoutExtension, '.markdown').
|
||||
[ self exportAsSton: mainTree on: fileStream.
|
||||
@ -413,6 +425,7 @@ GrafoscopioBrowser >> treeOn: constructor [
|
||||
"Menu options"
|
||||
act: [ GrafoscopioBrowser new openFromFile] entitled: 'Abrir/Cargar ...';
|
||||
act: [self saveToFile] entitled: 'Guardar como ...';
|
||||
act: [self exportAsHtml] entitled: 'Exportar como html';
|
||||
act: [self updateSystem] entitled: 'Actualizar Grafoscopio';
|
||||
act: [:x | x printString inspect] entitled: 'Acerca de...'.
|
||||
|
||||
|
@ -82,8 +82,7 @@ GrafoscopioNode >> addNodeAfter [
|
||||
|
||||
{ #category : #exporting }
|
||||
GrafoscopioNode >> asMarkdown [
|
||||
"Exports children of the curren node as pandoc markdown, using special nodes for config options and
|
||||
bibliography."
|
||||
"Exports children of the curren node as pandoc markdown, using special nodes for config options and bibliography."
|
||||
| markdownOutput |
|
||||
|
||||
markdownOutput := '' writeStream.
|
||||
|
Loading…
Reference in New Issue
Block a user