Better support for exporting to html using pandoc.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2015-07-10 18:17:17 +00:00
parent 3c1a134163
commit 8e4b697ced

View File

@ -175,13 +175,12 @@ GrafoscopioBrowser class >> openHelpInHtml [
| htmlHelpFileLocation | | htmlHelpFileLocation |
htmlHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.html') fullName. htmlHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.html') fullName.
Smalltalk platform name = 'unix' Smalltalk platform name = 'unix'
ifTrue: [ ifTrue: [OSProcess command: 'xdg-open ', htmlHelpFileLocation].
OSProcess command: 'xdg-open ', htmlHelpFileLocation.
].
Smalltalk platform name = 'Win32' Smalltalk platform name = 'Win32'
ifTrue: [ ifTrue: [OSProcess command: 'explorer ', htmlHelpFileLocation].
OSProcess command: 'explorer ', htmlHelpFileLocation. Smalltalk platform name = 'Mac OS'
]. ifTrue: [OSProcess command: 'open ', htmlHelpFileLocation].
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
@ -191,13 +190,11 @@ GrafoscopioBrowser class >> openHelpInPdf [
| pdfHelpFileLocation | | pdfHelpFileLocation |
pdfHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.pdf') fullName. pdfHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs' /'Es' / 'Manual' / 'manual-grafoscopio.pdf') fullName.
Smalltalk platform name = 'unix' Smalltalk platform name = 'unix'
ifTrue: [ ifTrue: [OSProcess command: 'xdg-open ', pdfHelpFileLocation].
OSProcess command: 'xdg-open ', pdfHelpFileLocation.
].
Smalltalk platform name = 'Win32' Smalltalk platform name = 'Win32'
ifTrue: [ ifTrue: [OSProcess command: 'explorer ', pdfHelpFileLocation].
OSProcess command: 'explorer ', pdfHelpFileLocation. Smalltalk platform name = 'Mac OS'
]. ifTrue: [OSProcess command: 'open ', pdfHelpFileLocation].
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
@ -408,7 +405,7 @@ GrafoscopioBrowser class >> updateUI [
self startDockingBar. self startDockingBar.
] ]
{ #category : #persistence } { #category : #'persistance / repositories' }
GrafoscopioBrowser >> addFileToRepository [ GrafoscopioBrowser >> addFileToRepository [
"Adds a selected file to a defined repository." "Adds a selected file to a defined repository."
@ -423,7 +420,8 @@ GrafoscopioBrowser >> addFileToRepository [
OSProcess command: OSProcess command:
'cd ', localRepository parent fullName, '; ', 'cd ', localRepository parent fullName, '; ',
fossil, ' add ', fileToAdd, '; ', fossil, ' add ', fileToAdd, '; ',
'echo "Added file to enabled repository"'. 'echo "Added file to enabled repository"'.
self inform: 'Archivo adicionado al repositorio'
] ]
{ #category : #tags } { #category : #tags }
@ -758,7 +756,7 @@ GrafoscopioBrowser >> customKeys [
stream nextPutAll: bibStream contents withUnixLineEndings ]]. stream nextPutAll: bibStream contents withUnixLineEndings ]].
] ]
{ #category : #persistence } { #category : #'persistance / repositories' }
GrafoscopioBrowser >> defineRemoteRepository [ GrafoscopioBrowser >> defineRemoteRepository [
"Defines a remote fossil repository from an url" "Defines a remote fossil repository from an url"
@ -766,7 +764,7 @@ GrafoscopioBrowser >> defineRemoteRepository [
statements" statements"
] ]
{ #category : #persistence } { #category : #'persistance / repositories' }
GrafoscopioBrowser >> enableLocalRepository [ GrafoscopioBrowser >> enableLocalRepository [
"Just a temporary message to enable working with fossil on a specific repository. This should be generalized" "Just a temporary message to enable working with fossil on a specific repository. This should be generalized"
@ -777,9 +775,12 @@ GrafoscopioBrowser >> enableLocalRepository [
extensions: #('fossil'). extensions: #('fossil').
fileStream isNil ifTrue: [ ^nil ]. fileStream isNil ifTrue: [ ^nil ].
localRepository := fileStream name asFileReference. localRepository := fileStream name asFileReference.
OSProcess command: (Smalltalk platform name = 'unix') | (Smalltalk platform name = 'Mac OS')
'cd ', localRepository parent fullName,';', ifTrue: [
'exec ', fossil, ' open ', localRepository fullName. OSProcess command:
'cd ', localRepository parent fullName,';',
'exec ', fossil, ' open ', localRepository fullName.
self inform: 'Repositorio local abierto.'].
] ]
{ #category : #persistence } { #category : #persistence }
@ -790,7 +791,7 @@ GrafoscopioBrowser >> exportAsHtml [
htmlFileLocation := ((workingFile parent) / workingFile basenameWithoutExtension) fullName, '.html'. htmlFileLocation := ((workingFile parent) / workingFile basenameWithoutExtension) fullName, '.html'.
pandoc notNil pandoc notNil
ifTrue:[ ifTrue:[
Smalltalk platform name = 'unix' (Smalltalk platform name = 'unix') | (Smalltalk platform name = 'Mac OS')
ifTrue: [ ifTrue: [
OSProcess command: 'exec ', pandoc, ' ', markdownFileLocation , ' --standalone -o ' , htmlFileLocation. OSProcess command: 'exec ', pandoc, ' ', markdownFileLocation , ' --standalone -o ' , htmlFileLocation.
OSProcess command: 'exec echo "exportando como html"'. OSProcess command: 'exec echo "exportando como html"'.
@ -1352,7 +1353,7 @@ GrafoscopioBrowser >> treeOn: constructor [
act: [self saveToFileUI] entitled: 'Guardar como ...' categorized: 'Arbol'; act: [self saveToFileUI] entitled: 'Guardar como ...' categorized: 'Arbol';
act: [self saveWorkingTree; exportAsHtml] entitled: 'Exportar como HTML' categorized: 'Arbol'; act: [self saveWorkingTree; exportAsHtml] entitled: 'Exportar como HTML' categorized: 'Arbol';
act: [self saveWorkingTree; exportAsPdf] entitled: 'Exportar como PDF (requiere LaTeX)' categorized: 'Arbol'; act: [self saveWorkingTree; exportAsPdf] entitled: 'Exportar como PDF (requiere LaTeX)' categorized: 'Arbol';
act: [self messageNotImplementedYet] entitled: 'Ver HTML' categorized: 'Arbol'; act: [self viewExportedHtml] entitled: 'Ver HTML' categorized: 'Arbol';
act: [self messageNotImplementedYet] entitled: 'Ver PDF' categorized: 'Arbol'; act: [self messageNotImplementedYet] entitled: 'Ver PDF' categorized: 'Arbol';
"For nodes" "For nodes"
@ -1382,8 +1383,22 @@ GrafoscopioBrowser >> treeOn: constructor [
"For projects" "For projects"
act: [self enableLocalRepository] entitled: 'Activar repositorio local...' categorized: 'Proyecto'; act: [self enableLocalRepository] entitled: 'Activar repositorio local...' categorized: 'Proyecto';
act: [self messageNotImplementedYet "addFileToRepository"] entitled: 'Agregar archivo' categorized: 'Proyecto'; act: [self addFileToRepository] entitled: 'Agregar archivo...' categorized: 'Proyecto';
act: [self messageNotImplementedYet] entitled: 'Eliminar archivo' categorized: 'Proyecto'; act: [self messageNotImplementedYet] entitled: 'Eliminar archivo...' categorized: 'Proyecto';
act: [self messageNotImplementedYet "repositoryCommit"] entitled: 'Enviar al histórico' categorized: 'Proyecto'; act: [self messageNotImplementedYet "repositoryCommit"] entitled: 'Enviar al histórico' categorized: 'Proyecto';
act: [self messageNotImplementedYet "repositoryCredentials"] entitled: 'Acreditarse' categorized: 'Proyecto'. act: [self messageNotImplementedYet "repositoryCredentials"] entitled: 'Acreditarse' categorized: 'Proyecto'.
] ]
{ #category : #persistence }
GrafoscopioBrowser >> viewExportedHtml [
"Exports the current tree to HTML, using the same name but different extension (.html)"
| htmlFileLocation |
htmlFileLocation := ((workingFile parent) / workingFile basenameWithoutExtension) fullName, '.html'.
Smalltalk platform name = 'unix'
ifTrue: [OSProcess command: 'xdg-open ', htmlFileLocation].
Smalltalk platform name = 'Win32'
ifTrue: [OSProcess command: 'explorer ', htmlFileLocation].
Smalltalk platform name = 'Mac OS'
ifTrue: [OSProcess command: 'open ', htmlFileLocation].
]