Giter VIP home page Giter VIP logo

obsidian-gitbook's Introduction

Obsidian GitBook

Deploy an Obsidian vault on GitBook.

This is a repository that turns an Obsidian project into a GitBook project, that can be linked with GitHub, so it will be automatically deployed. Just link your GitBook project with your fork of this repo, and run the deploy flow.

Manual Deployment

You can make the deploy by your own, moving the stuff manually, and making your commits.

Just copy your obsidian project to a directory (in the repo root) called obsidian. Commit and push. Every time that new code goes to GitHub, there's an action that automatically build the obsidian folder into a GitBook project under the gitbook folder.

Every time you want to update the code, copy and paste your obsidian vault into the obsidian folder, commit and push. Remember to pull before doing so.

Automatic deployment

If you don't want to be manually updating your GitBook deployment, you can follow this short guide. You will only need two repos:

Deploy repository

You can see an example here

  1. Fork this repository, and connect it with GitBook.
  2. Create a Personal Access Token (pat). Don't lose this, you will need it later, and there won't be a way to watching it again.
  3. Create a secret in your fork (Settings > Secets), called DEPLOY_PAT, and set its value to the PAT you've just created.

Obsidian repository

You can see an example here

  1. Create a repository for yor Obsidian vault, and push the changes there. You can check recursos-diseno-es as an example (check out the .gitignore, it might be useful for your vault)
  2. Create a secret in this repo (Settings > Secets), called DEPLOY_PAT, and set its value to the PAT you've created before.
  3. Create a folder called .github and, inside it, another called workflows. Right there, add a build-gitbook.yaml file like this:
name: Launch GitBook deploy workflow
on: push

jobs:
  run:
    name: Launch deploy actions
    runs-on: ubuntu-latest
    steps:
      - name: Deploy GitBook
        uses: actions/github-script@v5
        with:
          github-token: ${{ secrets.DEPLOY_PAT }}
          script: |
            await github.rest.actions.createWorkflowDispatch({
              owner: 'recursosdisenoes',
              repo: 'obsidian-gitbook',
              workflow_id: 'build-gitbook.yml',
              ref: 'main',
              inputs: {
                repo: '${{ github.repository }}',
              },
            });

Update the owner and repo values with your fork!

  1. Push your obsidian repository, and see the actions work together.

And that's all.

As soon as you push code to your Obsidian repository, it will trigget an action in your fork, so it will bring te obsidian vault, transformed into a GitBook project, and deployed automatically.

Status and known issues:

  • Transform Obsidian project in Gitbook project (naming and structure)
  • Generate a valid SUMMARY.md
  • Transform page links to plain markdown links (next-up)
  • Show all the pages linking to the current one (on the roadmap)
  • Link to blocks (on the roadmap)

Contributing

This project has been created for the Recursos de Diseño en Español (Design Resources in Spanish) project. The goal is to have an Open Source and tool to spread the knowledege in a well structured way.

It's a basic version, built in a few free hours of a few people volunteering. So it might not cover all the features you might want.

In case you want to add a feature, fix something that is not working propperly or improve some part of the code, feel free to add a PR.

obsidian-gitbook's People

Contributors

codingcarlos avatar

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.