Updating before migrating to other dev image.
This commit is contained in:
parent
4d76adc1c0
commit
a619230458
@ -57,6 +57,41 @@ FossilRepo >> fetchPage: pageName [
|
||||
^ NeoJSONReader fromString: (self jsonWikiDataFor: 'get/', pageName)
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
FossilRepo >> getFileContentsFor: anEmbeddedDocUrl [
|
||||
"Given the web page contents for a file, hosted in Fossil, I detect all the standard
|
||||
page decorations (chrome) and strip them to provide only file contents, contained between
|
||||
<blockquote><pre> HTML tags.."
|
||||
|
||||
| pageContentLines blockQuoteStart blockQuoteEnd fileContentLines fileContent |
|
||||
pageContentLines := (self getPageContentsFor: anEmbeddedDocUrl) lines.
|
||||
pageContentLines
|
||||
doWithIndex: [ :line :index |
|
||||
line = '<blockquote><pre>'
|
||||
ifTrue: [ blockQuoteStart := index ].
|
||||
line = '</pre></blockquote>'
|
||||
ifTrue: [ blockQuoteEnd := index ] ].
|
||||
fileContentLines := pageContentLines
|
||||
copyFrom: blockQuoteStart + 1
|
||||
to: blockQuoteEnd - 1.
|
||||
fileContent := WriteStream on: ''.
|
||||
fileContentLines do: [ :line | fileContent nextPutAll: line; crlf ].
|
||||
^ fileContent contents.
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
FossilRepo >> getPageContentsFor: anEmbeddedDocUrl [
|
||||
"I use the Fossil web interface to get the contents of a file.
|
||||
I'm useful if the file is posted online, but the repository contents are
|
||||
not locally available.
|
||||
|
||||
anEmbeddedDocUrl should have the schema presented at:
|
||||
|
||||
https://www.fossil-scm.org/xfer/doc/trunk/www/embeddeddoc.wiki"
|
||||
|
||||
^ (ZnEasy get: anEmbeddedDocUrl, '?mimetype=text/plain') contents.
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
FossilRepo >> isUnversioned: aFileNameWithRelativePath [
|
||||
|
||||
@ -167,7 +202,9 @@ FossilRepo >> whoAmI [
|
||||
|
||||
{ #category : #wiki }
|
||||
FossilRepo >> wikiRoot [
|
||||
^ self jsonRoot addPathSegment: 'wiki'
|
||||
^ self remote
|
||||
addPathSegments: #('json' 'wiki')
|
||||
"addPathSegment: 'wiki' "
|
||||
]
|
||||
|
||||
{ #category : #wiki }
|
||||
|
Loading…
Reference in New Issue
Block a user