How viable would it be to make a command module to delete some tiddlers, 
rename some, then save the file? How would you run it from the command 
line? Well maybe I just found out:

This is an interesting command from build-site.sh 
<https://github.com/Jermolene/TiddlyWiki5/blob/master/bin/build-site.sh>.
node $TW5_BUILD_TIDDLYWIKI \
    $TW5_BUILD_MAIN_EDITION \
    --verbose \
    --version \
    --load $TW5_BUILD_OUTPUT/build.tid \
    --output $TW5_BUILD_OUTPUT \
    --build favicon static index \
    || exit 1

It doesn't use the tiddlywiki command from npm 
<https://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js>, it uses 
the node <https://tiddlywiki.com/#Node.js>command to run tiddlywiki.js 
<https://github.com/Jermolene/TiddlyWiki5/blob/master/tiddlywiki.js> 
directly as a command, passing the command line arguments to the boot 
kernel, which is the thing that gets tiddlywiki started. So you could make 
a custom command module <https://tiddlywiki.com/#Modules>then run it this 
way, though I'm not sure it would work with a standalone TiddlyWiki. You 
would have to use --savewikifolder 
<https://tiddlywiki.com/#SaveWikiFolderCommand> to convert the standalone 
to a node 
<https://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js>version, 
then run node tiddlywiki.js with some arguments, then this command which I 
found hidden away here <https://tiddlywiki.com/#tiddlywiki.info%20Files>: 
tiddlywiki 
--verbose --load wiki.html --rendertiddler "$:/core/save/all" "index.html" 
"text/plain", to convert it back to a standalone TiddlyWiki. This would 
allow you to manipulate a TiddlyWiki in literally any way you wanted from 
the command line, which would enable the automation of a lot of tasks.

I think many users would be able to utilise this given some guidance on how 
to make command modules, and greater clarity on all the options available 
to them with regards to the command line.

*Side note:* Found this nifty command while trying to understand what the build 
command <https://tiddlywiki.com/#BuildCommand> does, it does do what I 
wanted earlier, renders standalone to standalone, brilliant.
tiddlywiki --verbose --load wiki.html --rendertiddler "$:/core/save/all" 
"index.html" "text/plain"
Makes me wonder if there are more core modules that do useful things when 
used in combination with the command line arguments.

By the way, the build command <https://tiddlywiki.com/#BuildCommand> just 
runs some commands stored in the tiddlywiki.info 
<https://tiddlywiki.com/#tiddlywiki.info%20Files> file.

Kalcifer

On Monday, May 25, 2020 at 6:35:32 AM UTC+1, Kalcifer Kandari wrote:
>
> Please have a look here:
>>
>> https://tiddlywiki.com/prerelease/#Generating%20Static%20Sites%20with%20TiddlyWiki
>>
>
> I'm not trying to generate a static site, rather export part of a 
> standalone site to another standalone site, then do some renaming.
>
> I get the impression that, with the command line, you can convert a 
> standalone wiki to a node.js wiki, but not the other way around, or from 
> standalon to standalone.
>
> Kalcifer
>
> On Monday, May 25, 2020 at 6:28:14 AM UTC+1, Mohammad wrote:
>>
>> Please have a look here:
>>
>> https://tiddlywiki.com/prerelease/#Generating%20Static%20Sites%20with%20TiddlyWiki
>>
>>
>> Best wishes
>> Mohammad
>>
>>
>> On Mon, May 25, 2020 at 9:11 AM Kalcifer Kandari <[email protected]> 
>> wrote:
>>
>>> Thanks, but that still give a similar error:
>>>
>>> Error: ENOENT: no such file or directory, open 
>>> 'E:\path\local\output\$:\boot\boot.css.html'
>>>
>>> Kalcifer
>>>
>>> On Monday, May 25, 2020 at 4:21:27 AM UTC+1, Mohammad wrote:
>>>>
>>>>
>>>> Use
>>>> tiddlywiki mywiki --render "[all[]]-[tag[private]]"
>>>>
>>>> change mywiki with your wiki folder name. This is when you run the 
>>>> command from a parent folder
>>>> if not give the correct wiki folder path, if you run from inside the 
>>>> wiki folder just issue
>>>> tiddlywiki  --render "[all[]]-[tag[private]]"  
>>>>
>>>> Best wishes
>>>> Mohammad
>>>>
>>>>
>>>> On Mon, May 25, 2020 at 7:30 AM Kalcifer Kandari <[email protected]> 
>>>> wrote:
>>>>
>>>>> So, I'm working on a fancy script to publish my site by just running a 
>>>>> single command. I want to do this because the working wiki is a mix of 
>>>>> public and private tiddlers, which is much easier to work with that 2 
>>>>> separate wikis, given they share a lot of tiddlers. I'm using the 
>>>>> standalone wiki, because far as I know, exposing the node.js version to 
>>>>> the 
>>>>> internet is not viable as visitors could edit the site.
>>>>>
>>>>> The command will do something like this:
>>>>>
>>>>>    1. robocopy /mir the local folder to a staging folder.
>>>>>    2. In the staging folder, from the original HTML file export some 
>>>>>    tiddlers based on this filter[all[]]-[tag[private]] to a new HTML 
>>>>>    file, then delete the original HTML file.
>>>>>    3. Then rename a few tiddlers, such as index--public to index.
>>>>>    4. robocopy /mir the staging folder to the server, and delete the 
>>>>>    staging folder.
>>>>>    
>>>>> So 2 and 3 are where I'm at.
>>>>>
>>>>> *For 2: *I'm trying to use tiddlywiki wiki.html --render 
>>>>> "[all[]]-[tag[private]]", but it's just throwing an error:
>>>>>
>>>>> Error: ENOENT: no such file or directory, open 
>>>>> 'E:\path\wiki.html\output\$:\boot\boot.css.html'
>>>>>
>>>>> My suspicion is that the tiddlywiki command only works for node.js 
>>>>> wikis?
>>>>>
>>>>> *For 3:* I've looked at the tiddlywiki wiki.html --setField 
>>>>> documentation <https://tiddlywiki.com/static/SetFieldCommand.html>, 
>>>>> and it says "*templatetitle* - the tiddler to wikify into the 
>>>>> specified field. If blank or missing then the specified field is 
>>>>> deleted", 
>>>>> I'm not clear on what that means. I would expect to be able to run 
>>>>> tiddlywiki 
>>>>> wiki.html --setField "[title[index--public]]" "title" "index", 
>>>>> although I haven't got so far to be able to try that out yet.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Kalcifer
>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "TiddlyWikiDev" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/tiddlywikidev/5cf4d25b-5d4e-42ed-b9c9-1429c0030ed9%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/tiddlywikidev/5cf4d25b-5d4e-42ed-b9c9-1429c0030ed9%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "TiddlyWikiDev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tiddlywikidev/2b94bea4-5d7b-4734-a75f-f118ccb3b5c4%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/tiddlywikidev/2b94bea4-5d7b-4734-a75f-f118ccb3b5c4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/7a912caa-8248-4931-81d4-4d5244b87460%40googlegroups.com.

Reply via email to