From a3c5cd6285b7916c77e5262a3743b3d14f1bf805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Thu, 21 Mar 2024 22:00:05 +0100 Subject: [PATCH] Fixing links --- .../MicDocumentWriter.class.st | 27 ++--- .../MicExportBrush.class.st | 9 +- .../MicExportCanvas.class.st | 49 +++++---- .../MicInlineBlockWithUrl.extension.st | 8 +- .../MicLaTeXBrush.class.st | 11 +- .../MicLaTeXCanvas.class.st | 17 +-- .../MicLaTeXCommand.class.st | 9 +- .../MicLaTeXEnvironment.class.st | 11 +- .../MicLaTeXWriter.class.st | 103 +++++++++--------- .../MicLatexPathUpdateVisitor.class.st | 19 ++-- .../MicSBALaTeXWriter.class.st | 25 +++-- .../MicTableBlock.extension.st | 4 +- src/Microdown-LaTeXExporter/package.st | 2 +- 13 files changed, 152 insertions(+), 142 deletions(-) diff --git a/src/Microdown-LaTeXExporter/MicDocumentWriter.class.st b/src/Microdown-LaTeXExporter/MicDocumentWriter.class.st index b9693df1..e81d7d80 100644 --- a/src/Microdown-LaTeXExporter/MicDocumentWriter.class.st +++ b/src/Microdown-LaTeXExporter/MicDocumentWriter.class.st @@ -3,41 +3,42 @@ I'm the superclass of writers in various formats. I managed end of line conventions, canvas responsible for the encodings of specific commands to output a given format and I support raw ouputting. " Class { - #name : #MicDocumentWriter, - #superclass : #MicrodownVisitor, + #name : 'MicDocumentWriter', + #superclass : 'MicrodownVisitor', #instVars : [ 'canvas', 'nbListTab', 'writingRaw' ], - #category : #'Microdown-LaTeXExporter' + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #accessing } +{ #category : 'accessing' } MicDocumentWriter >> canvasClass [ ^ self subclassResponsibility ] -{ #category : #writing } +{ #category : 'writing' } MicDocumentWriter >> contents [ ^ canvas contents ] -{ #category : #initialization } +{ #category : 'initialization' } MicDocumentWriter >> crAsNewLine [ canvas crAsNewLine ] -{ #category : #initialization } +{ #category : 'initialization' } MicDocumentWriter >> crlfAsNewLine [ canvas crlfAsNewLine ] -{ #category : #initialization } +{ #category : 'initialization' } MicDocumentWriter >> initialize [ | stream | super initialize. @@ -47,34 +48,34 @@ MicDocumentWriter >> initialize [ nbListTab := -1 ] -{ #category : #initialization } +{ #category : 'initialization' } MicDocumentWriter >> lfAsNewLine [ canvas lfAsNewLine ] -{ #category : #initialization } +{ #category : 'initialization' } MicDocumentWriter >> usedNewLine [ "Return the encoded new line. Useful for tests." ^ canvas stream usedNewLine ] -{ #category : #writing } +{ #category : 'writing' } MicDocumentWriter >> visit: aMicElement [ aMicElement accept: self. ^ self contents ] -{ #category : #writing } +{ #category : 'writing' } MicDocumentWriter >> write: aMicElement [ "for now for integration with Pillar." self visit: aMicElement. ^ self contents ] -{ #category : #writing } +{ #category : 'writing' } MicDocumentWriter >> writeRawDuring: aBlock [ [ diff --git a/src/Microdown-LaTeXExporter/MicExportBrush.class.st b/src/Microdown-LaTeXExporter/MicExportBrush.class.st index c3bc7651..3b473ee3 100644 --- a/src/Microdown-LaTeXExporter/MicExportBrush.class.st +++ b/src/Microdown-LaTeXExporter/MicExportBrush.class.st @@ -4,15 +4,16 @@ I'm the superclass of all brushes. A brush is something you can add on a canvas. Copied from Pillar " Class { - #name : #MicExportBrush, - #superclass : #Object, + #name : 'MicExportBrush', + #superclass : 'Object', #instVars : [ 'stream' ], - #category : #'Microdown-LaTeXExporter' + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #initialization } +{ #category : 'initialization' } MicExportBrush >> setStream: aStream [ stream := aStream ] diff --git a/src/Microdown-LaTeXExporter/MicExportCanvas.class.st b/src/Microdown-LaTeXExporter/MicExportCanvas.class.st index 6025acba..8a563f2c 100644 --- a/src/Microdown-LaTeXExporter/MicExportCanvas.class.st +++ b/src/Microdown-LaTeXExporter/MicExportCanvas.class.st @@ -4,24 +4,25 @@ I am the place where the visitors will write stuff. I output everything to a str Copied from Pillar " Class { - #name : #MicExportCanvas, - #superclass : #Object, + #name : 'MicExportCanvas', + #superclass : 'Object', #instVars : [ 'stream', 'currentBrush', 'writingRaw' ], - #category : #'Microdown-LaTeXExporter' + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicExportCanvas class >> on: aStream [ ^ self new setStream: aStream; yourself ] -{ #category : #private } +{ #category : 'private' } MicExportCanvas >> brush: aBrush [ self flush. currentBrush := aBrush. @@ -29,49 +30,49 @@ MicExportCanvas >> brush: aBrush [ ^ aBrush ] -{ #category : #accessing } +{ #category : 'accessing' } MicExportCanvas >> contents [ ^ stream contents ] -{ #category : #accessing } +{ #category : 'accessing' } MicExportCanvas >> crAsNewLine [ stream crAsNewLine ] -{ #category : #accessing } +{ #category : 'accessing' } MicExportCanvas >> crlfAsNewLine [ stream crlfAsNewLine ] -{ #category : #accessing } +{ #category : 'accessing' } MicExportCanvas >> flush [ stream flush ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> initialize [ super initialize. writingRaw := false ] -{ #category : #accessing } +{ #category : 'accessing' } MicExportCanvas >> lfAsNewLine [ stream lfAsNewLine ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> line: aString [ self nextPutAll: aString; newLine ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> lines: aString [ "Output aString and take care of line ending within aString." | str | @@ -84,55 +85,55 @@ MicExportCanvas >> lines: aString [ ] ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> newLine [ stream newLine ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> nextPut: aCharacter [ stream nextPut: aCharacter ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> nextPutAll: aString [ aString do: [ :char | self nextPut: char ] ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> nextPutAllLines: aString [ self withLinesIn: aString do: [ :line | self nextPutAll: line ] separatedBy: [ self newLine ] ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> raw: aString [ stream << aString ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> rawLines: aString [ "Output aString and take care of line ending within aString." self withLinesIn: aString do: [ :line | self raw: line ] separatedBy: [ self newLine ] ] -{ #category : #initialization } +{ #category : 'initialization' } MicExportCanvas >> setStream: aStream [ stream := aStream ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> space [ stream space ] -{ #category : #accessing } +{ #category : 'accessing' } MicExportCanvas >> stream [ "Pay attention to what you do with this stream. You may break the canvas logic" ^ stream ] -{ #category : #private } +{ #category : 'private' } MicExportCanvas >> withLinesIn: aString do: aBlock separatedBy: anotherBlock [ "this method shows that the body of code block is weak because it should encapsulate the way it internally represents lines. Now this is exposed in clients." | str | @@ -146,7 +147,7 @@ MicExportCanvas >> withLinesIn: aString do: aBlock separatedBy: anotherBlock [ ifFalse: anotherBlock ] ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicExportCanvas >> writingRaw: aBoolean [ writingRaw := aBoolean diff --git a/src/Microdown-LaTeXExporter/MicInlineBlockWithUrl.extension.st b/src/Microdown-LaTeXExporter/MicInlineBlockWithUrl.extension.st index d9821b34..7248b374 100644 --- a/src/Microdown-LaTeXExporter/MicInlineBlockWithUrl.extension.st +++ b/src/Microdown-LaTeXExporter/MicInlineBlockWithUrl.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MicInlineBlockWithUrl } +Extension { #name : 'MicInlineBlockWithUrl' } -{ #category : #'*Microdown-LaTeXExporter' } +{ #category : '*Microdown-LaTeXExporter' } MicInlineBlockWithUrl >> fileStringWithoutHostFile [ | urlString localFileIndicator | urlString := url asString. @@ -10,13 +10,13 @@ MicInlineBlockWithUrl >> fileStringWithoutHostFile [ ifFalse: [ urlString ] ] -{ #category : #'*Microdown-LaTeXExporter' } +{ #category : '*Microdown-LaTeXExporter' } MicInlineBlockWithUrl >> fullName [ ^ reference fullName ] -{ #category : #'*Microdown-LaTeXExporter' } +{ #category : '*Microdown-LaTeXExporter' } MicInlineBlockWithUrl >> hasCaption [ ^ children notEmpty diff --git a/src/Microdown-LaTeXExporter/MicLaTeXBrush.class.st b/src/Microdown-LaTeXExporter/MicLaTeXBrush.class.st index 2ac28437..e405fdcb 100644 --- a/src/Microdown-LaTeXExporter/MicLaTeXBrush.class.st +++ b/src/Microdown-LaTeXExporter/MicLaTeXBrush.class.st @@ -2,12 +2,13 @@ Command and environment LaTeX brushes common superclass. " Class { - #name : #MicLaTeXBrush, - #superclass : #MicExportBrush, - #category : #'Microdown-LaTeXExporter' + #name : 'MicLaTeXBrush', + #superclass : 'MicExportBrush', + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXBrush >> optParameter: aStringOrBlock [ stream << $[ @@ -15,7 +16,7 @@ MicLaTeXBrush >> optParameter: aStringOrBlock [ << $] ] -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXBrush >> parameter: aStringOrBlock [ stream << ${ diff --git a/src/Microdown-LaTeXExporter/MicLaTeXCanvas.class.st b/src/Microdown-LaTeXExporter/MicLaTeXCanvas.class.st index d1790cc6..6040c6a1 100644 --- a/src/Microdown-LaTeXExporter/MicLaTeXCanvas.class.st +++ b/src/Microdown-LaTeXExporter/MicLaTeXCanvas.class.st @@ -2,15 +2,16 @@ I'm a specialized canvas to emit commands and latex environments. " Class { - #name : #MicLaTeXCanvas, - #superclass : #MicExportCanvas, + #name : 'MicLaTeXCanvas', + #superclass : 'MicExportCanvas', #classVars : [ 'LatexCharacters' ], - #category : #'Microdown-LaTeXExporter' + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #'class initialization' } +{ #category : 'class initialization' } MicLaTeXCanvas class >> initialize [ " self initialize " LatexCharacters := Dictionary new. @@ -86,17 +87,17 @@ MicLaTeXCanvas class >> initialize [ at: $Ñ put: '\~{N}' ] -{ #category : #tags } +{ #category : 'tags' } MicLaTeXCanvas >> command [ ^ self brush: MicLaTeXCommand new ] -{ #category : #tags } +{ #category : 'tags' } MicLaTeXCanvas >> environment [ ^ self brush: MicLaTeXEnvironment new ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicLaTeXCanvas >> interpretedNextPut: aCharacter [ (LatexCharacters at: aCharacter ifAbsent: nil) @@ -104,7 +105,7 @@ MicLaTeXCanvas >> interpretedNextPut: aCharacter [ ifNotNil: [ :string | self raw: string ] ] -{ #category : #'writing text' } +{ #category : 'writing text' } MicLaTeXCanvas >> nextPut: aCharacter [ writingRaw diff --git a/src/Microdown-LaTeXExporter/MicLaTeXCommand.class.st b/src/Microdown-LaTeXExporter/MicLaTeXCommand.class.st index 67a5d5b4..11eea55a 100644 --- a/src/Microdown-LaTeXExporter/MicLaTeXCommand.class.st +++ b/src/Microdown-LaTeXExporter/MicLaTeXCommand.class.st @@ -8,12 +8,13 @@ To emit `\mycommand` potentially with arguments and optionals. ``` " Class { - #name : #MicLaTeXCommand, - #superclass : #MicLaTeXBrush, - #category : #'Microdown-LaTeXExporter' + #name : 'MicLaTeXCommand', + #superclass : 'MicLaTeXBrush', + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXCommand >> name: aString [ stream diff --git a/src/Microdown-LaTeXExporter/MicLaTeXEnvironment.class.st b/src/Microdown-LaTeXExporter/MicLaTeXEnvironment.class.st index a791ed79..37776e8c 100644 --- a/src/Microdown-LaTeXExporter/MicLaTeXEnvironment.class.st +++ b/src/Microdown-LaTeXExporter/MicLaTeXEnvironment.class.st @@ -10,21 +10,22 @@ kjlkjkl ``` " Class { - #name : #MicLaTeXEnvironment, - #superclass : #MicLaTeXBrush, + #name : 'MicLaTeXEnvironment', + #superclass : 'MicLaTeXBrush', #instVars : [ 'name' ], - #category : #'Microdown-LaTeXExporter' + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXEnvironment >> name: aString [ name := aString. stream << '\begin{' << aString << '}' ] -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXEnvironment >> with: aBlock [ stream newLine. diff --git a/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st b/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st index 9072ee69..65b8da1e 100644 --- a/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st +++ b/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st @@ -2,22 +2,23 @@ I'm producing a textual latex version of a microdown document. " Class { - #name : #MicLaTeXWriter, - #superclass : #MicDocumentWriter, - #category : #'Microdown-LaTeXExporter' + #name : 'MicLaTeXWriter', + #superclass : 'MicDocumentWriter', + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXWriter class >> fileExtension [ ^ 'tex' ] -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXWriter class >> folderName [ ^ #latex ] -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXWriter class >> toLatexPath: aString [ "Replace all (windows style) back slashes in paths by (unix style) forward slashes. This is required as path in latex only support unix style pathes like @@ -33,28 +34,28 @@ MicLaTeXWriter class >> toLatexPath: aString [ ^ aString copyReplaceAll: '\' with: '/' ] -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXWriter class >> writerName [ ^ #miclatex ] -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXWriter >> canvas [ ^ canvas ] -{ #category : #accessing } +{ #category : 'accessing' } MicLaTeXWriter >> canvasClass [ ^ MicLaTeXCanvas ] -{ #category : #templating } +{ #category : 'templating' } MicLaTeXWriter >> chapterTemplateName [ ^ 'latexChapterTemplate' ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> createLinkToLabelWithAlias: anInternalLink [ canvas command name: 'hyperref'; @@ -65,7 +66,7 @@ MicLaTeXWriter >> createLinkToLabelWithAlias: anInternalLink [ canvas nextPutAll: anInternalLink alias ] ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> createLinkToLabelWithoutAlias: anInternalLink [ canvas command @@ -73,7 +74,7 @@ MicLaTeXWriter >> createLinkToLabelWithoutAlias: anInternalLink [ parameter: [ canvas raw: anInternalLink substring ] ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> getStringForAll: aCollection [ "Visit each element of aCollection and exports everything to a new stream. Answer the stream content." | visitor | @@ -82,7 +83,7 @@ MicLaTeXWriter >> getStringForAll: aCollection [ ^ visitor contents ] -{ #category : #'visiting-document' } +{ #category : 'visiting-document' } MicLaTeXWriter >> includeGraphicsFor: aFigure [ canvas command @@ -93,33 +94,33 @@ MicLaTeXWriter >> includeGraphicsFor: aFigure [ ] -{ #category : #protected } +{ #category : 'protected' } MicLaTeXWriter >> monospaceMacro [ ^ 'code' ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> protectUrl: aString [ ^ ((aString copyReplaceAll: '\' with: '\\') copyReplaceAll: '#' with: '\#') copyReplaceAll: '%' with: '\%' ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> sectioningCommands [ ^ #('part' 'chapter' 'section' 'subsection' 'subsubsection' 'paragraph' 'subparagraph') ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> tabList [ 0 to: nbListTab do: [ :nothing | canvas raw: ' ' ] ] -{ #category : #protected } +{ #category : 'protected' } MicLaTeXWriter >> tabularEnvironment [ ^ 'tabular' ] -{ #category : #'visiting-document' } +{ #category : 'visiting-document' } MicLaTeXWriter >> typeOfSectionFor: aHeader [ | sections level section | sections := self sectioningCommands. @@ -128,26 +129,26 @@ MicLaTeXWriter >> typeOfSectionFor: aHeader [ ^ section ] -{ #category : #blocks } +{ #category : 'blocks' } MicLaTeXWriter >> visitAnchor: anAnchor [ canvas command name: 'label'; parameter: anAnchor label ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitAnchorReference: anAchorReference [ self createLinkToLabelWithoutAlias: anAchorReference ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitBold: aBold [ canvas command name: 'textbf'; parameter: [ super visitBold: aBold ] ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitCitation: aCitation [ canvas command name: 'cite'; @@ -155,7 +156,7 @@ MicLaTeXWriter >> visitCitation: aCitation [ ] -{ #category : #'blocks - code' } +{ #category : 'blocks - code' } MicLaTeXWriter >> visitCode: aCodeBlock [ | env parameters | parameters := OrderedCollection new. @@ -175,7 +176,7 @@ MicLaTeXWriter >> visitCode: aCodeBlock [ canvas newLine ] ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitFigure: aFigure [ (aFigure hasCaption not and: [ aFigure hasLabel not ]) ifTrue: [ @@ -197,12 +198,12 @@ MicLaTeXWriter >> visitFigure: aFigure [ canvas newLine ] ] ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitFootnote: aFootnote [ canvas command name: 'footnote'; parameter: (aFootnote note) ] -{ #category : #blocks } +{ #category : 'blocks' } MicLaTeXWriter >> visitHeader: aHeader [ | section | canvas newLine. @@ -212,7 +213,7 @@ MicLaTeXWriter >> visitHeader: aHeader [ parameter: [ super visitHeader: aHeader ] ] -{ #category : #blocks } +{ #category : 'blocks' } MicLaTeXWriter >> visitHorizontalLine: aHorizontalLine [ canvas newLine. @@ -220,25 +221,25 @@ MicLaTeXWriter >> visitHorizontalLine: aHorizontalLine [ canvas newLine. ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitItalic: anItalic [ canvas command name: 'textit'; parameter: [ super visitItalic: anItalic ] ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitLink: aLink [ | reference | reference := aLink fileStringWithoutHostFile. - canvas command + "canvas command name: 'href'; parameter: reference; - parameter: [ self visitAll: aLink children ]. + parameter: [ self visitAll: aLink children ]." canvas command name: 'footnotesize'; parameter: [ canvas command name: 'url'; parameter: (self protectUrl: reference) ] ] -{ #category : #'blocks - list' } +{ #category : 'blocks - list' } MicLaTeXWriter >> visitListItem: anItem [ self tabList. canvas command name: 'item'. @@ -247,14 +248,14 @@ MicLaTeXWriter >> visitListItem: anItem [ canvas newLine ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitMonospace: aMonospace [ canvas command name: self monospaceMacro; parameter: [ super visitMonospace: aMonospace ] ] -{ #category : #'blocks - list' } +{ #category : 'blocks - list' } MicLaTeXWriter >> visitOrderedList: aList [ "tabulation for \begin{itemize} it can do in the environment of the canvas" canvas newLine. @@ -269,14 +270,14 @@ MicLaTeXWriter >> visitOrderedList: aList [ nbListTab = -1 ifTrue: [canvas newLine] ] -{ #category : #blocks } +{ #category : 'blocks' } MicLaTeXWriter >> visitParagraph: aParagraph [ canvas newLine. super visitParagraph: aParagraph. canvas newLine. ] -{ #category : #blocks } +{ #category : 'blocks' } MicLaTeXWriter >> visitQuote: aQuote [ canvas environment name: 'verbatim'; @@ -285,12 +286,12 @@ MicLaTeXWriter >> visitQuote: aQuote [ canvas newLine ] ] ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicLaTeXWriter >> visitStrike: aStrike [ canvas command name: 'sout'; parameter: [ super visitStrike: aStrike ] ] -{ #category : #'blocks - table' } +{ #category : 'blocks - table' } MicLaTeXWriter >> visitTable: aTable [ | environment | canvas newLine. @@ -307,7 +308,7 @@ MicLaTeXWriter >> visitTable: aTable [ canvas newLine ] ] -{ #category : #'blocks - table' } +{ #category : 'blocks - table' } MicLaTeXWriter >> visitTableCell: aCell [ aCell isAligned ifFalse: [ self writeTableCellContent: aCell ] @@ -319,12 +320,12 @@ MicLaTeXWriter >> visitTableCell: aCell [ parameter: [ self writeTableCellContent: aCell ] ] ] -{ #category : #'blocks - table' } +{ #category : 'blocks - table' } MicLaTeXWriter >> visitTableCell: aCell with: aBool [ self writeTableCellContent: aCell with: aBool ] -{ #category : #'blocks - table' } +{ #category : 'blocks - table' } MicLaTeXWriter >> visitTableRow: aRow [ self visitAll: aRow children separatedBy: [ canvas raw: ' & ' ]. canvas @@ -336,7 +337,7 @@ MicLaTeXWriter >> visitTableRow: aRow [ canvas newLine ] ] -{ #category : #'blocks - table' } +{ #category : 'blocks - table' } MicLaTeXWriter >> visitTableRow: aRow with: aBool at: anIndex [ aRow do: [ :cell | self visitTableCell: cell with: (aBool and: [ anIndex = 1 ]) ] separatedBy: [ canvas raw: ' & ' ]. canvas @@ -348,13 +349,13 @@ MicLaTeXWriter >> visitTableRow: aRow with: aBool at: anIndex [ canvas newLine ] ] -{ #category : #blocks } +{ #category : 'blocks' } MicLaTeXWriter >> visitText: aText [ canvas nextPutAllLines: aText bodystring ] -{ #category : #'blocks - list' } +{ #category : 'blocks - list' } MicLaTeXWriter >> visitUnorderedList: aList [ "tabulation for \begin{itemize} it can do in the environment of the canvas" @@ -370,13 +371,13 @@ MicLaTeXWriter >> visitUnorderedList: aList [ nbListTab = -1 ifTrue: [canvas newLine] ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> writeCaptionOfExternalLink: anExternalLink [ self visitAll: anExternalLink children ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> writeGraphicsParametersOfExternalLink: anExternalLink [ canvas @@ -387,7 +388,7 @@ MicLaTeXWriter >> writeGraphicsParametersOfExternalLink: anExternalLink [ raw: '\textwidth' ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> writeLabelOfExternalLink: anExternalLink [ "we decided not to create an arbitrary label when there is none specified. This decision should be changed but we need to find a way to uniquely identify a figure, math, ..." @@ -402,7 +403,7 @@ MicLaTeXWriter >> writeLabelOfExternalLink: anExternalLink [ parameter: [ canvas raw: label ] ] ] -{ #category : #helpers } +{ #category : 'helpers' } MicLaTeXWriter >> writeTableCellContent: aCell [ ^ aCell isHeading ifTrue: [ @@ -412,7 +413,7 @@ MicLaTeXWriter >> writeTableCellContent: aCell [ ifFalse: [ super visitTableCell: aCell ] ] -{ #category : #'blocks - table' } +{ #category : 'blocks - table' } MicLaTeXWriter >> writeTableCellContent: aCell with: aBool [ ^ aBool ifTrue: [ diff --git a/src/Microdown-LaTeXExporter/MicLatexPathUpdateVisitor.class.st b/src/Microdown-LaTeXExporter/MicLatexPathUpdateVisitor.class.st index 584fd004..1b52e3e8 100644 --- a/src/Microdown-LaTeXExporter/MicLatexPathUpdateVisitor.class.st +++ b/src/Microdown-LaTeXExporter/MicLatexPathUpdateVisitor.class.st @@ -10,40 +10,41 @@ C:/Program Files/Something For now I'm a copy and paste from Pillar (to avoid to have to patch all the visit API). " Class { - #name : #MicLatexPathUpdateVisitor, - #superclass : #MicrodownVisitor, - #category : #'Microdown-LaTeXExporter' + #name : 'MicLatexPathUpdateVisitor', + #superclass : 'MicrodownVisitor', + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #visiting } +{ #category : 'visiting' } MicLatexPathUpdateVisitor class >> isAbstract [ ^ false ] -{ #category : #visiting } +{ #category : 'visiting' } MicLatexPathUpdateVisitor class >> key [ ^ #latexPathUpdate ] -{ #category : #visiting } +{ #category : 'visiting' } MicLatexPathUpdateVisitor class >> start: aDocument [ ^ self new start: aDocument ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } MicLatexPathUpdateVisitor >> newReferenceFor: aReference [ ^ aReference reference copyReplaceAll: '\' with: '/' ] -{ #category : #visiting } +{ #category : 'visiting' } MicLatexPathUpdateVisitor >> visitFigure: aFigure [ aFigure reference: (self newReferenceFor: aFigure). super visitFigure: aFigure ] -{ #category : #unused } +{ #category : 'unused' } MicLatexPathUpdateVisitor >> visitInternalLink: anInternalLink [ anInternalLink hasReference ifTrue: [ anInternalLink reference: (self newReferenceFor: anInternalLink) ]. diff --git a/src/Microdown-LaTeXExporter/MicSBALaTeXWriter.class.st b/src/Microdown-LaTeXExporter/MicSBALaTeXWriter.class.st index 54d082aa..ded66bf6 100644 --- a/src/Microdown-LaTeXExporter/MicSBALaTeXWriter.class.st +++ b/src/Microdown-LaTeXExporter/MicSBALaTeXWriter.class.st @@ -3,27 +3,28 @@ I'm version producing LaTeX for the SBA template. In the future (once the templatedWriter is working) I should get removed. " Class { - #name : #MicSBALaTeXWriter, - #superclass : #MicLaTeXWriter, - #category : #'Microdown-LaTeXExporter' + #name : 'MicSBALaTeXWriter', + #superclass : 'MicLaTeXWriter', + #category : 'Microdown-LaTeXExporter', + #package : 'Microdown-LaTeXExporter' } -{ #category : #accessing } +{ #category : 'accessing' } MicSBALaTeXWriter class >> writerName [ ^ #miclatex:sbabook ] -{ #category : #accessing } +{ #category : 'accessing' } MicSBALaTeXWriter >> folderName [ ^ #latex ] -{ #category : #protected } +{ #category : 'protected' } MicSBALaTeXWriter >> monospaceMacro [ ^ 'textcode' ] -{ #category : #protected } +{ #category : 'protected' } MicSBALaTeXWriter >> optionalParametersForFloatingScript: aCodeBlock [ | parameters | @@ -33,17 +34,17 @@ MicSBALaTeXWriter >> optionalParametersForFloatingScript: aCodeBlock [ ^ parameters asCommaString ] -{ #category : #protected } +{ #category : 'protected' } MicSBALaTeXWriter >> tabularEnvironment [ ^ 'fullwidthtabular' ] -{ #category : #accessing } +{ #category : 'accessing' } MicSBALaTeXWriter >> templateForConfiguration: aConfiguration [ ^ 'main.mustache' ] -{ #category : #protected } +{ #category : 'protected' } MicSBALaTeXWriter >> visitCode: aCodeBlock [ aCodeBlock hasCaption | aCodeBlock hasLabel @@ -51,7 +52,7 @@ MicSBALaTeXWriter >> visitCode: aCodeBlock [ ifFalse: [ self writeInFlowCodeSnippet: aCodeBlock ] ] -{ #category : #protected } +{ #category : 'protected' } MicSBALaTeXWriter >> writeFloatingCodeSnippet: aCodeBlock [ canvas environment name: 'listing'; @@ -65,7 +66,7 @@ MicSBALaTeXWriter >> writeFloatingCodeSnippet: aCodeBlock [ canvas newLine ] ] -{ #category : #protected } +{ #category : 'protected' } MicSBALaTeXWriter >> writeInFlowCodeSnippet: aCodeBlock [ canvas environment name: 'displaycode'; diff --git a/src/Microdown-LaTeXExporter/MicTableBlock.extension.st b/src/Microdown-LaTeXExporter/MicTableBlock.extension.st index 80128b30..45f80f17 100644 --- a/src/Microdown-LaTeXExporter/MicTableBlock.extension.st +++ b/src/Microdown-LaTeXExporter/MicTableBlock.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MicTableBlock } +Extension { #name : 'MicTableBlock' } -{ #category : #'*Microdown-LaTeXExporter' } +{ #category : '*Microdown-LaTeXExporter' } MicTableBlock >> latexSpecification [ ^ String new: rows first size withAll: $l ] diff --git a/src/Microdown-LaTeXExporter/package.st b/src/Microdown-LaTeXExporter/package.st index d2fbf944..f335d1cf 100644 --- a/src/Microdown-LaTeXExporter/package.st +++ b/src/Microdown-LaTeXExporter/package.st @@ -1 +1 @@ -Package { #name : #'Microdown-LaTeXExporter' } +Package { #name : 'Microdown-LaTeXExporter' }