Setting up releas 1.4 stable.
This commit is contained in:
parent
7d4cc79cf2
commit
01f6e38520
@ -60,7 +60,9 @@ GrafoscopioNotebook class >> open: aFileReference [
|
|||||||
{ #category : #utilities }
|
{ #category : #utilities }
|
||||||
GrafoscopioNotebook >> addCommandFrom: dictionary into: stream [
|
GrafoscopioNotebook >> addCommandFrom: dictionary into: stream [
|
||||||
dictionary keysAndValuesDo: [ :k :v |
|
dictionary keysAndValuesDo: [ :k :v |
|
||||||
k = 'thisNotebook' ifTrue: [ stream nextPutAll: (self perform: #markdownFileChecksumUpto: with: 10) ] ]
|
k = 'thisNotebook'
|
||||||
|
ifTrue: [
|
||||||
|
stream nextPutAll: (GrafoscopioUtils perform: v on: self) ]]
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'editing nodes' }
|
{ #category : #'editing nodes' }
|
||||||
@ -183,7 +185,9 @@ GrafoscopioNotebook >> exportAsLaTeX [
|
|||||||
I suppose pandoc is already installed and available in the system."
|
I suppose pandoc is already installed and available in the system."
|
||||||
| texFile |
|
| texFile |
|
||||||
self markdownFile exists ifTrue: [ self markdownFile delete ].
|
self markdownFile exists ifTrue: [ self markdownFile delete ].
|
||||||
self exportAsMarkdown.
|
"self exportAsMarkdown.""<- This violates the separation of concenrs. Markdown exportation should
|
||||||
|
be explicit. There is still the issue of how to deal with desynchronization between a notebook
|
||||||
|
which has unsaved changes as markdown.... TO BE REVIWED!"
|
||||||
texFile := self markdownFile parent fullName,'/', self markdownFile basenameWithoutExtension, '.tex'.
|
texFile := self markdownFile parent fullName,'/', self markdownFile basenameWithoutExtension, '.tex'.
|
||||||
texFile asFileReference exists ifTrue: [ texFile asFileReference delete ].
|
texFile asFileReference exists ifTrue: [ texFile asFileReference delete ].
|
||||||
OSProcess command: 'pandoc --standalone ', self markdownFile fullName, ' -o ', texFile.
|
OSProcess command: 'pandoc --standalone ', self markdownFile fullName, ' -o ', texFile.
|
||||||
@ -203,16 +207,14 @@ GrafoscopioNotebook >> exportAsPDF [
|
|||||||
"I export the current tree/document to a PDF file, using pandoc and LaTeX external apps.
|
"I export the current tree/document to a PDF file, using pandoc and LaTeX external apps.
|
||||||
The latex engine used is xelatex, to minimize errors and warnings related with UTF8 support.
|
The latex engine used is xelatex, to minimize errors and warnings related with UTF8 support.
|
||||||
I suppose all them are already installed and defined in the system."
|
I suppose all them are already installed and defined in the system."
|
||||||
| pdfFile pandocCommand |
|
| pandocCommand |
|
||||||
self markdownFile exists ifFalse: [ self exportAsMarkdown ].
|
self markdownFile exists ifFalse: [ self exportAsMarkdown ].
|
||||||
pdfFile := self markdownFile parent fullName,'/', self markdownFile basenameWithoutExtension, '.pdf'.
|
self pdfFile ensureDelete.
|
||||||
pdfFile asFileReference exists ifTrue: [ pdfFile asFileReference delete ].
|
pandocCommand := 'cd ', self markdownFile parent fullName,'; ',
|
||||||
pandocCommand := 'cd ', self workingFile parent fullName,'; pandoc ',
|
'pandoc ', self pandocOptionsComputed, ' ',
|
||||||
self pandocOptionsComputed, ' ',
|
self markdownFile fullName, ' -o ', self pdfFile fullName.
|
||||||
self markdownFile fullName, ' -o ', pdfFile.
|
|
||||||
Transcript show: pandocCommand.
|
|
||||||
ExternalUnixOSProcess command: pandocCommand.
|
ExternalUnixOSProcess command: pandocCommand.
|
||||||
self inform: ('File exported as: ', String cr, pdfFile)
|
self inform: ('File exported as: ', String cr, self pdfFile fullName)
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #persistence }
|
{ #category : #persistence }
|
||||||
@ -352,7 +354,10 @@ GrafoscopioNotebook >> markdownFileChecksum [
|
|||||||
|
|
||||||
{ #category : #utilities }
|
{ #category : #utilities }
|
||||||
GrafoscopioNotebook >> markdownFileChecksumUpto: anInteger [
|
GrafoscopioNotebook >> markdownFileChecksumUpto: anInteger [
|
||||||
^ self markdownFileChecksum copyFrom: 1 to: anInteger.
|
"I cut the markdownFileCheckup upto a given integer.
|
||||||
|
Type coersion is needed, because this message argument can be read from a string in %metadata nodes.
|
||||||
|
Maybe the way used by playgrounds to import text as commands can be useful here."
|
||||||
|
^ self markdownFileChecksum copyFrom: 1 to: anInteger asInteger.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'editing nodes' }
|
{ #category : #'editing nodes' }
|
||||||
@ -562,6 +567,15 @@ GrafoscopioNotebook >> pasteNodeFromClipboard [
|
|||||||
self notebookContent: notebook.
|
self notebookContent: notebook.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #persistence }
|
||||||
|
GrafoscopioNotebook >> pdfFile [
|
||||||
|
"I define the location of the markdown file where the notebook will be exported"
|
||||||
|
| pdfFile |
|
||||||
|
pdfFile := (self markdownFile parent fullName,'/', self markdownFile basenameWithoutExtension, '.pdf') asFileReference.
|
||||||
|
^ pdfFile.
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #initialization }
|
{ #category : #initialization }
|
||||||
GrafoscopioNotebook >> projectSubMenu [
|
GrafoscopioNotebook >> projectSubMenu [
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user