GithubHelp home page GithubHelp logo

roam-garden / roam-export Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 0.0 200 KB

A set of tools to Filter/transform/render RoamResearch JSON export. Used in Roam Garden

Home Page: https://roam.garden/

License: Apache License 2.0

TypeScript 65.18% JavaScript 34.67% Batchfile 0.15%
roam-garden roamresearch roam json roam-export

roam-export's Introduction

roam-export

Export filtering and processing library for https://roam.garden/

Installation

npm i roam-export

Usage

A basic usage is as follows:

import { RoamBlock, RoamJsonQuery, RoamPage } from "roam-export"
import { readFileSync } from "fs"

const data = readFileSync("path to json export", "utf8")
const allPages = JSON.parse(data) as Array<RoamPage>
  
const { pages, blockUids } = new RoamJsonQuery(allPages, 
  {makePagesWithTheseTagsPublic: ["make-public"], makeBlocksWithTheseTagsPrivate: []}).getPagesToRender()
  
// do something with pages

There are more tools for operating on Roam JSON available internally (see https://github.com/roam-garden/roam-export/blob/master/src/roam-utils.ts and https://github.com/roam-garden/roam-export/blob/master/src/filtering.ts)

roam-export's People

Contributors

stvad avatar

Stargazers

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

Watchers

 avatar  avatar

roam-export's Issues

instructions for manual filtering of files

This looks amazing, it's exactly what I need to be able to filter pages
to make them plugin.
edit: to make them public. (accidental typo)

I saw you mentioning this in the gatsby digital garden issues

mathieudutour/gatsby-digital-garden#31

Would you mind elaborating a bit on the README on how to use this for the purposes of manually filtering files

Thanks a lot

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.