Giter VIP home page Giter VIP logo

tw5-auto-publish2gh-pages's Introduction

We all love Github pages. They are an easy,reliable and cheap way to host static sites. TiddlyWiki is a single page web application wiki that can be hosted as a single html file. It is an awesome unique application, and I strongly recommend you to check it out at TiddlyWiki.com. The problem with it is that there is not an easy fast way to host a tiddlywiki file on github pages... until now.

This repository is both a template and a set of instructions to host a tiddlywiki on your own Github pages repository. Following this instructions you will be able to have your own wiki up and running in less than 10 minutes without any git or Github Knowledge and without installing any software on your computer.

Using this work-flow has several advantages:

  1. Github pages are absolutely free and reliable
  2. Tiddlers are built from individual .tid files
  3. Built in changes history and diff
  4. Github allows you to edit and add files directly from their web interface, so you don't have to install anything in your computer.
  5. No git or Github Knowledge required

Table of Contents

Requisites

The list of pre-requisites is quite small, and you only need to fit them once

First time setup

This are the steps required for the first time setup. Once you have completed all the steps listed here for the first time it will be much faster to just add new wikis.

Github setup

  1. We have to create a Personal access token to allow our publish scripts to push to our github account. This is only needed on the first time setup. Go to Github's tokens management page
  2. Create a new token clicking on Generate new token
  3. Provide a meaningful token description. This is very important because it will be the only clue you will have to identify the token usage.
  4. Make sure repo and public_repo options are selected
  5. Click on Generate token. Here is an overview of this step: Generate token
  6. Github will generate an unique token. Take note of it now because you will not have any other opportunity!!

Creating the first wiki

  1. Fork this repository. This step will be necessary on every new wiki. As I have promised you can do this directly from Github, just click the Fork button on the top righ corner of this repository page: Fork button
  2. Once you have forked the repository, you can rename it to fit your needs.
  3. Go to Travis-ci and sign in using your github account.
  4. If this is the first time you are using Travis just authorize the application to access your github account.
  5. Once you have accessed your Travis account you will be directed to your dashboard.
  6. On the left side of your dashboard you should have a list of the repositories under Travis management. At the first time this list should be empty.
  7. Click the plus sign next to My Repositories to put the forked repository under Travis management: Add Repository
  8. You will be redirected to your profile. Here you have to locate the repository you have just forked and activate the "switch" to put it under Travis management. This should be easy because Travis provides an explanatory screen shot.
  9. If you don't find the repository you are looking for, click the Sync button to refresh the list of repositories: Add Repository
  10. In our example we are activating this Github repository: Activate Repository
  11. Now it's time to setup the global variables required by our build scripts. To do so click on the gear icon next to the "activate" switch: config Repository
  12. You should be now at the Settings page of the repository. Leave the General settings as they are by default.
  13. On the Environment Variables section We are going to add the required variables.
    1. First add GH_REF, which is the url of **your forked repository without the https prefix and with a .git extension. For this variable you can set to on the Display value in build log, so you can check that it is correct on every build. Click add first variable
    2. Follow the same process to add the GH_TOKEN variable, but this time make sure that Display value in build log is set to off for security reasons. Paste here the Github token we have generated previously: Token variable
    3. Follow the exact same process to add GH_EMAIL variable. This should be the email you have used to register your account on github. After this process you should see something like this: Variables Setup
    4. Changes are saved automatically so at this point we are done with configuration and can switch to current tab.
  14. Switch to current tab to see what is going on during build process. The build process happens every time you push a change to your repository and not before. An ongoing build looks like this: Building
  15. Now you are ready to go. Edit any file or create any new file your forked repository and push the changes to trigger a build. You can do this directly from Github. For more details about this process see the Editing tiddlers section
  16. Once the build has finished successfully you can just visit <your-git-username>.github.io/your-repo-name to see the results of your build

Creating another wiki

Once you have completed the first time setup, it is much easier to setup another wiki. Here is a summary of the required Steps:

  1. Fork this repository: Fork button
  2. Rename the repository to fit your needs.
  3. Go to Travis-ci and sign in using your github account.
  4. On the left side of your dashboard click the plus sign next to My Repositories to put the forked repository under Travis management: Add Repository
  5. Locate the repository you have just forked and activate the "switch" to put it under Travis management.
  6. If you don't find the repository you are looking for, click the Sync button to refresh the list of repositories: Add Repository
  7. Setup the global variables
  8. Edit/add the required tiddlers and make a push. This can be done directly on github.

Editing tiddlers

You can just edit or add new tiddlers directly on github, which is quite comfortable, or you can use a markdown editor. Tiddlywiki syntax is not exactly markdown, but it is close enough to use it as a small reference and markdown editors usually helps you completing lists and provide preview.

I recommend you to use prose, which is the tool I have used to edit this README:

Prose

  1. visit https://prose.io/
  2. You have to link it to github, so you can edit and save the files on your repository
  3. Click on Authorize aplication and authorize it on Github
  4. Once you have authorized the application you can start creating and editing tiddlers:
    1. Select the repository of your wiki
    2. Navigate to wiki>tiddlers directory
    3. Select the tiddler you want to edit or create a new file. If you create a new file make sure you give it a .tid extension.
    4. Once you have your "tiddler ready" click the save icon. You can provide a commit message if you want.

Dilinger

To edit markdown files you have a better alternative which is dillinger. The drawback of dilinger is that it only recognizes .md files:

  1. visit https://dillinger.io/
  2. You can link it to github, so you can edit and save the files on your repository
  3. To be able to save to github, you have to first import the tiddler you want to edit from there. The first time you will have to authorize the application:
    1. Click on IMPORT FROM
    2. On the drop down select Github
    3. Authorize the application if needed
    4. Select the repository you want to edit, and select the master branch
    5. Navigate to wiki>tiddlers directory
    6. Select the tiddler you want to edit
  4. Once you have your "tiddler ready" click SAVE TO and select github

tw5-auto-publish2gh-pages's People

Contributors

danielo515 avatar hegart-dmishiv avatar scarejar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tw5-auto-publish2gh-pages's Issues

How to Serve a Single TW5 "Export all Tiddlers" (HTML Extension) File?

Hi Danielo:

Thanks for the effort and expertise you have put into this new project! Can this system support the following use case?

I would like to upload a single TW5 file (named: "my-new-project.html") into the project space (in whatever appropriate spot is best) and configure it (with appropriate syntax) in the "tiddlywiki.info" file.

Details:

  • When a new user (me) wants to try TW5, I download a new empty wiki file.
  • I end up with a single HTML file, that I can name to something like: 'my-new-project.html".
  • (Well, we know it's not "just" an HTML file, it's also whole lot of JavaScript "magic dust" as well).
  • I get busy & make a bunch of new tiddlers, maybe hundreds. But to naive user (me) it's still a single HTML file.
  • When I'm done, I would like to upload "my-new-project.html" to my own fork (of your project) and have it served from there.
  • But I see the current build configuration seems to be based on .tid files.
  • And if I try to "export all tiddlers" into a tid file, I find out that TW5 only exports a single tiddler.

So, am I stuck? Or is there a way to configure a Travis CI "build" for a single html file?

The best of all possible worlds for me would be to upload my completed TW5 wiki as a single HTML file into the wiki directory, edit one or more config files to say: "look for this target HTML file", let Travis CI detect the push event and have the auto-config "magic" do its stuff.

Best regards,

-- Daniel

Cannot edit $:/favicon.ico

I have a custom favicon in my old online (dev) public wiki hosted on Google Drive. I'm trying to migrate this to my new online public wiki hosted on GitHub. What I see in the GitHub web UI is that the favicon file has been split in two. The favicon.ico file, which appears to be binary content, according to your commit #a240676, is not editable in my cloned repo. The favicon.ico.meta file only contains the basic tiddler info...

title: $:/favicon.ico
type: image/x-icon

...which is editable, but seems useless without the other part, which I assume is the base64-encoded binary data comprising the image itself. The resultant file hosted on GitHub is a single unified tiddler, as would normally be expected. I have no idea how to change my favicon now because of this.

I have also raised this issue in the discussion forums.

TRAVIS show build error

Shows the following message when I tried to build my wiki at https://ibnishak.github.io/irreverant-mudblood/#

$:/core/modules/editor/engines/framed.js:35

this.iframeDoc = this.iframeNode.contentWindow.document;

                                              ^

TypeError: Cannot read property 'document' of undefined

at new FramedEngine ($:/core/modules/editor/engines/framed.js:35:48)

at EditTextWidget.render ($:/core/modules/editor/factory.js:60:17)

at $:/core/modules/widgets/widget.js:346:15

at Object.$tw.utils.each (/home/travis/.nvm/versions/node/v7.0.0/lib/node_modules/tiddlywiki/boot/boot.js:69:12)

at EditWidget.Widget.renderChildren ($:/core/modules/widgets/widget.js:345:12)

at EditWidget.render ($:/core/modules/widgets/edit.js:33:7)

at $:/core/modules/widgets/widget.js:346:15

at Object.$tw.utils.each (/home/travis/.nvm/versions/node/v7.0.0/lib/node_modules/tiddlywiki/boot/boot.js:69:12)

at TranscludeWidget.Widget.renderChildren ($:/core/modules/widgets/widget.js:345:12)

at TranscludeWidget.render ($:/core/modules/widgets/transclude.js:33:7)

The command "tiddlywiki ./*wiki --build" exited with 1.

Upgrade Issue - TW is 5.1.9 ?

Installing the TW5-auto-publish2gh-pages uses TW 5.1.9 and even rebuilding the project does not upgrade the TW.

The Job log in Travis shows the TW 5.1.16 is installed but the TW in GH pages tells it is 5.1.9 (Note: I cross checked this by creating new tiddler with <> content)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.