JOSS article: Fixing installation problems.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-04-28 15:41:04 +00:00
parent c03e827e50
commit 6d86c83c62
5 changed files with 80 additions and 42 deletions

View File

@ -368,7 +368,6 @@ GrafoscopioBrowser >> openFromFile: aFileName [
mainTree := GrafoscopioNode new mainTree := GrafoscopioNode new
header: (currentChildren at: 1) parent header; header: (currentChildren at: 1) parent header;
level: (currentChildren at: 1) parent level; level: (currentChildren at: 1) parent level;
metadata: (currentChildren at: 1) parent metadata;
children: currentChildren. children: currentChildren.
browser openOn: mainTree children. browser openOn: mainTree children.
] ]
@ -395,7 +394,6 @@ GrafoscopioBrowser >> openFromFileSelector [
mainTree := GrafoscopioNode new mainTree := GrafoscopioNode new
header: (currentChildren at: 1) parent header; header: (currentChildren at: 1) parent header;
level: (currentChildren at: 1) parent level; level: (currentChildren at: 1) parent level;
metadata: (currentChildren at: 1) parent metadata;
children: currentChildren. children: currentChildren.
browser openOn: mainTree children. browser openOn: mainTree children.
] ]

View File

@ -88,9 +88,11 @@ GrafoscopioDocumentation class >> listOutdated [
] ]
{ #category : #updating } { #category : #updating }
GrafoscopioDocumentation class >> listOutdatedDocsIn: aDocumentsName [ GrafoscopioDocumentation class >> listOutdatedDocsIn: aDocumentsListName [
"I return the list of all documentent where the local copy and the remote copy doesn't match" "I return the list of all documentent where the local copy and the remote copy doesn't match"
^ (self perform: aDocumentsName asSymbol) documents reject: [ :doc | (self isFileUpdatedFor: doc) ] aDocumentsListName ifNil: [ ^ self ].
aDocumentsListName ifEmpty: [ ^ self ].
^ (self perform: aDocumentsListName asSymbol) documents reject: [ :doc | (self isFileUpdatedFor: doc) ]
] ]
{ #category : #updating } { #category : #updating }

View File

@ -23,7 +23,6 @@ Class {
'node', 'node',
'level', 'level',
'nodesInPreorder', 'nodesInPreorder',
'metadata',
'links', 'links',
'output' 'output'
], ],
@ -176,13 +175,12 @@ GrafoscopioNode >> asMarkdown [
| markdownOutput | | markdownOutput |
markdownOutput := '' writeStream. markdownOutput := '' writeStream.
self exportPreambleTo: markdownOutput. self metadataAsYamlIn: markdownOutput.
(self preorderTraversal) do: [ :eachNode | (self preorderTraversal) do: [ :eachNode |
(eachNode level > 0) (eachNode level > 0)
ifTrue: [(eachNode hasAncestorTaggedAs: 'invisible') | (eachNode tags = 'invisible') ifTrue: [(eachNode hasAncestorTaggedAs: 'invisible') | (eachNode tags = 'invisible')
ifFalse: [ markdownOutput nextPutAll: (eachNode markdownContent) ]]]. ifFalse: [ markdownOutput nextPutAll: (eachNode markdownContent) ]]].
^markdownOutput contents ^markdownOutput contents
] ]
{ #category : #exporting } { #category : #exporting }
@ -262,9 +260,9 @@ GrafoscopioNode >> bodyAsCode [
| codeBody | | codeBody |
codeBody := '' writeStream. codeBody := '' writeStream.
codeBody codeBody
nextPutAll: ('~~~{.numberLines}'); lf; nextPutAll: '~~~{.numberLines}'; lf;
nextPutAll: (self body contents asString withInternetLineEndings); lf; nextPutAll: (self body contents asString withInternetLineEndings); lf;
nextPutAll: ('~~~'); lf; lf. nextPutAll: '~~~'; lf; lf.
^ codeBody contents ^ codeBody contents
] ]
@ -383,7 +381,7 @@ GrafoscopioNode >> exportCodeBlockTo: aStream [
GrafoscopioNode >> exportCodeNodeTo: aStream [ GrafoscopioNode >> exportCodeNodeTo: aStream [
"I convert the content of a node taged as 'código' (code) as pandoc markdown and put it "I convert the content of a node taged as 'código' (code) as pandoc markdown and put it
into aStream." into aStream."
(self headerStartsWith: '%output') ((self headerStartsWith: '%output') or: [ self headerStartsWith: '%metadata' ])
ifTrue: [ self exportCodeOutputTo: aStream ] ifTrue: [ self exportCodeOutputTo: aStream ]
ifFalse: [ self exportCodeBlockTo: aStream ] ifFalse: [ self exportCodeBlockTo: aStream ]
] ]
@ -392,8 +390,9 @@ GrafoscopioNode >> exportCodeNodeTo: aStream [
GrafoscopioNode >> exportCodeOutputTo: aStream [ GrafoscopioNode >> exportCodeOutputTo: aStream [
"I convert the output of a node taged as 'código' (code) as pandoc markdown and put it "I convert the output of a node taged as 'código' (code) as pandoc markdown and put it
into aStream." into aStream."
(self headerStartsWith: '%metadata') ifTrue: [ ^ self ].
aStream nextPutAll: ('~~~{.numberLines}'); lf. aStream nextPutAll: ('~~~{.numberLines}'); lf.
aStream nextPutAll: ((Compiler evaluate: self body) asString withInternetLineEndings); lf. aStream nextPutAll: (self output asString withInternetLineEndings); lf.
aStream nextPutAll: ('~~~'); lf;lf. aStream nextPutAll: ('~~~'); lf;lf.
^aStream contents ^aStream contents
] ]
@ -551,9 +550,14 @@ GrafoscopioNode >> key: aUniqueKey [
{ #category : #accessing } { #category : #accessing }
GrafoscopioNode >> lastLink [ GrafoscopioNode >> lastLink [
links ifNil: [ ^ '' ]. self links ifNil: [ ^ '' ].
links ifEmpty: [ ^ '' ]. self links ifEmpty: [ ^ '' ].
^ links last ^ self links last
]
{ #category : #accessing }
GrafoscopioNode >> lastNetLink [
^ self links detect: [ :l | l asZnUrl isURL ]
] ]
{ #category : #accessing } { #category : #accessing }
@ -585,14 +589,24 @@ GrafoscopioNode >> links: anObject [
{ #category : #operation } { #category : #operation }
GrafoscopioNode >> linksToMarkdownFile [ GrafoscopioNode >> linksToMarkdownFile [
"I detect if the links contains any reference to a file ending in '.md' or '.markdown'" "I detect if the links contains any reference to a file ending in '.md' or '.markdown'"
self links ifNotNil: [ self links
ifNotNil: [
self links self links
detect: [:l | (l endsWith: '.md') or: [ l endsWith: '.markdown']] detect: [:l | (l endsWith: '.md') or: [ l endsWith: '.markdown']]
ifFound: [ ^ true ] ifFound: [ ^ true ]
ifNone: [^ false]] ifNone: [^ false]].
^ false
] ]
{ #category : #operation }
GrafoscopioNode >> localFilesLinks [
"I collect all the links that point to the local file system. Because is supposed that
links contains only references to remote URL or local files, anything that is not a URL is
treated as a loca file link."
^ self links reject: [ :l | l asZnUrl isURL ]
]
{ #category : #exporting } { #category : #exporting }
GrafoscopioNode >> margin [ GrafoscopioNode >> margin [
"I define the same margin of the page used for PDF exportations" "I define the same margin of the page used for PDF exportations"
@ -635,14 +649,28 @@ GrafoscopioNode >> markdownContent [
^ markdownStream contents ^ markdownStream contents
] ]
{ #category : #accessing } { #category : #operation }
GrafoscopioNode >> metadata [ GrafoscopioNode >> metadata [
^ metadata | mnode |
mnode := self root preorderTraversal detect: [:n | n headerStartsWith: '%metadata' ].
^ mnode output.
] ]
{ #category : #accessing } { #category : #exporting }
GrafoscopioNode >> metadata: anObject [ GrafoscopioNode >> metadataAsYamlIn: markdownStream [
metadata := anObject "I convert the first '%metadata' node into a YAML preamble to be used by Pandoc exportation."
markdownStream
nextPutAll: '---';
lf.
self metadata
keysAndValuesDo: [ :k :v |
markdownStream
nextPutAll: (k , ': ' , v asString) withInternetLineEndings;
nextPutAll: String cr ].
markdownStream
nextPutAll: '---';
lf; lf
] ]
{ #category : #movement } { #category : #movement }
@ -683,7 +711,9 @@ GrafoscopioNode >> newNode [
{ #category : #accessing } { #category : #accessing }
GrafoscopioNode >> output [ GrafoscopioNode >> output [
^ output self tags ~= 'código' ifTrue: [ ^ self ].
self body ifNil: [ ^ nil ].
^ (Compiler evaluate: self body)
] ]
{ #category : #accessing } { #category : #accessing }
@ -691,6 +721,11 @@ GrafoscopioNode >> output: anObject [
output := anObject output := anObject
] ]
{ #category : #utility }
GrafoscopioNode >> pandocOptions [
^ self metadata at: 'pandocOptions' ifAbsent: [ ^ '' ]
]
{ #category : #accessing } { #category : #accessing }
GrafoscopioNode >> parent [ GrafoscopioNode >> parent [
"Returns the parent of the current node" "Returns the parent of the current node"
@ -715,20 +750,13 @@ GrafoscopioNode >> pasteFromClipboard [
] ]
{ #category : #exporting } { #category : #operation }
GrafoscopioNode >> preorderTraversal [ GrafoscopioNode >> preorderTraversal [
nodesInPreorder := OrderedCollection new. nodesInPreorder := OrderedCollection new.
self visitedGoTo: nodesInPreorder. self visitedGoTo: nodesInPreorder.
^ nodesInPreorder. ^ nodesInPreorder.
] ]
{ #category : #accessing }
GrafoscopioNode >> processOutput [
(self headerStartsWith: '%output')
ifFalse: [ ^ self ].
^ self output: (Compiler evaluate: self body)
]
{ #category : #movement } { #category : #movement }
GrafoscopioNode >> promote [ GrafoscopioNode >> promote [
"Moves the current node up in the hierachy, making it a slibing of its current parent" "Moves the current node up in the hierachy, making it a slibing of its current parent"
@ -787,10 +815,10 @@ GrafoscopioNode >> removeNode: aNode [
{ #category : #accessing } { #category : #accessing }
GrafoscopioNode >> root [ GrafoscopioNode >> root [
"I return the node of the Grafoscopio tree that contains the receiver" "I return the root node of the Grafoscopio tree, i.e the common ancestor of all other nodes"
self level = 0 self level = 0
ifTrue: [ ^ self ] ifFalse: [ ^ self ancestors first ].
ifFalse: [ ^ self ancestors first. ] ^ self
] ]
{ #category : #accessing } { #category : #accessing }
@ -838,8 +866,9 @@ GrafoscopioNode >> title [
{ #category : #operation } { #category : #operation }
GrafoscopioNode >> visitLastLink [ GrafoscopioNode >> visitLastLink [
links ifNil: [ self inform: 'This node has no associated links to visit'. ^ self ]. self lastLink = ''
[WebBrowser openOn: self lastLink] fork. ifTrue: [ self inform: 'This node has no associated links to visit'. ^ self ].
[WebBrowser openOn: self lastLink] fork
] ]
{ #category : #'add/remove nodes' } { #category : #'add/remove nodes' }

View File

@ -146,12 +146,16 @@ 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 | | pdfFile pandocCommand |
self markdownFile exists ifFalse: [ self exportAsMarkdown ]. self markdownFile exists ifFalse: [ self exportAsMarkdown ].
pdfFile := self markdownFile parent fullName,'/', self markdownFile basenameWithoutExtension, '.pdf'. pdfFile := self markdownFile parent fullName,'/', self markdownFile basenameWithoutExtension, '.pdf'.
pdfFile asFileReference exists ifTrue: [ pdfFile asFileReference delete ]. pdfFile asFileReference exists ifTrue: [ pdfFile asFileReference delete ].
OSProcess command: 'pandoc --latex-engine=xelatex ', self markdownFile fullName, ' -o ', pdfFile. pandocCommand := 'pandoc ',
self inform: ('File exported as: ', String cr, pdfFile). self notebook pandocOptions, ' ',
self markdownFile fullName, ' -o ', pdfFile.
Transcript show: pandocCommand.
ExternalUnixOSProcess command: pandocCommand.
self inform: ('File exported as: ', String cr, pdfFile)
] ]
{ #category : #persistence } { #category : #persistence }

View File

@ -22,6 +22,11 @@ ManifestGrafoscopio class >> ruleRBBooleanPrecedenceRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'GrafoscopioNode class' #cleanTreeRootReferences #true)) #'2017-03-27T22:18:17.447627-05:00') ) ^ #(#(#(#RGMethodDefinition #(#'GrafoscopioNode class' #cleanTreeRootReferences #true)) #'2017-03-27T22:18:17.447627-05:00') )
] ]
{ #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBCascadedNextPutAllsRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#GrafoscopioNode #metadataAsYamlIn: #false)) #'2017-04-20T19:01:59.286212-05:00') )
]
{ #category : #'code-critics' } { #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBClassNameInSelectorRuleV1FalsePositive [ ManifestGrafoscopio class >> ruleRBClassNameInSelectorRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'Documentation class' #current #true)) #'2016-10-07T19:39:23.013722-05:00') ) ^ #(#(#(#RGMethodDefinition #(#'Documentation class' #current #true)) #'2016-10-07T19:39:23.013722-05:00') )