Create a counter component with
- Some text displaying total count
- An "increment" button
- A "decrement" button
| workflow jgi_read_qc | |
| { | |
| File raw_fastq | |
| Array[String] sketch_dbs = [ "nt", "refseq", "silva" ] | |
| call subsample | |
| { | |
| input: | |
| infile=raw_fastq | |
| } |
| # A task is a docker image, a command, and optional hardware prefs | |
| # A pipeline is a collection of sequential or parallel tasks with a shared volume mount | |
| # Pipelines are submitted to HTCondor | |
| # A small application layer would handle the job submission to HTCondor, | |
| # pulling docker images and running containers with correct mounts and settings | |
| # Define an HTCondor job with a docker image, command, and node requirements or preferences | |
| subsample = Task( | |
| image='jgi/subsample', |
| # Define a docker workflow (independent of KBase) | |
| # - output and input files | |
| # - minimum node requirements for a job | |
| # - whether to exit on any failure or continue on failure | |
| # - pass through environment variables | |
| # - htcondor, etc backend | |
| # - automatically figure out serial and concurrent execution based on task input and output | |
| def subsample(): |
| Simple doc fetch | |
| { | |
| coll: "wsprov_object", | |
| keys: ["1:2:3"], | |
| user_ids: [], | |
| page_limit: 10 | |
| } | |
| produces aql: |
| const Component = require('..') | |
| const h = require('../h') | |
| // A single counter that can be incremented and decremented | |
| const Counter = function (start) { | |
| return Component('div', { | |
| count: start, | |
| add: ({ count }, n) => ({ count: count + n }), | |
| view: ({ count, add }) => { | |
| return h('div', [ |
Regexes could be a lot more readable with a little bit more verbosity
Match an exact string with single quotes: 'hello world'
Match either strings: 'hello' | 'world' (matches 'hello' or 'world')
One downside of JSON is it is not very readable, especially when used as a configuration language.
To fix this, we can embed JSON data in a markdown file using a certain format that is readable and commentable. A script takes the markdown file and converts it into one or more JSON files.
Define the start of a JSON file in your markdown with a header that is a link to a local json file, such as:
## [my_config.json](my_config.json)
Throughout the spec we use JSON schema documents
/docs serves a list of your endpoints.
["products", "orders", "customers"]