Giter VIP home page Giter VIP logo

vliz-be-opsci / rocrate-to-pages Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 168 KB

Action that will make github repo that contains a (more? versioned?) RO-Crate metadata-json into a proper machine accessible ROCrate including a ro-crate-preview.html using our widget these typically get published as subfolders of the root

License: MIT License

Python 82.34% Dockerfile 1.11% Shell 3.22% HTML 13.33%
github-actions javascript react rocrate

rocrate-to-pages's Introduction

ROcrate-to-pages

This is a gh-action to generate a GitHub Pages site from a github repo containing a RO-Crate.

index

Overview of the action

global_overview_action

Usage

Construct a config.yml file using the flowchart below. The config.yml file should be in the root of the repo.

flowchart

action part

- name: RO-Crate to Pages
  uses:
    - ro-crate-to-pages@v1
    with:
        config: .config.yml

full workflow example

full yml example of a workflow file that will run the action on push

name: RO-Crate to Pages
on:
  push:
    branches:
      - main
jobs:
    build:
        runs-on: ubuntu-latest
        steps:
        - name: Checkout
          uses: actions/checkout@v3
        - name: RO-Crate to Pages
          uses: vliz-be-opsci/rocrate-to-pages@latest
          with:
            config: .config.yml
        # Deploy to GH-Pages branch
        - name: Deploy
          uses: peaceiris/actions-gh-pages@v3
          with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            publish_dir: ./unicornpages

Example config.yml

example config.yml explanation

  • multiple_rocrates: if true, the action will look for multiple rocrates in the repo, and generate a page for each of them. If false, it will only look for one rocrate in the repo, and generate a page for that one.

  • RELEASE_management: if true, the action will look for a release, and generate a page for that release. If false, it will generate a page for the latest commit on the main branch.

  • RELEASE_verioning: if RELEASE_management is true, this will determine how the action will look for the release. If tag, it will look for the latest release by tag. If release, it will look for the latest release by release.

  • INCLUDE_draft: if RELEASE_management is true, this will determine if the action will include the draft release. If true, it will include the draft release. If false, it will not include the draft release.

  • index_html: if true, the action will generate an index.html file for each rocrate. If false, it will not generate an index.html file for each rocrate.

  • draft_folder_name: if RELEASE_management is true, and INCLUDE_draft is true, this will determine the name of the folder for the draft release. If draft, the folder will be named draft. If draft_release, the folder will be named draft_release.

  • theme: if filled in this will be the theme used for the generated pages. If not filled in, the default theme will be used. Currently available themes:

!important note: multiple_rocrates and RELEASE_management are mutually exclusive. If multiple_rocrates is true, RELEASE_management will be ignored.!

config.yml examples

config.yml example 1

  1. multiple_rocrates: false
  2. RELEASE_management: true
  3. RELEASE_versioning: tag
  4. INCLUDE_draft: true
  5. index_html: true
  6. draft_folder_name: draft
  7. theme: dark
# config.yml
multiple_rocrates: false
RELEASE_management: true
RELEASE_versioning: tag #by major tag or by release
INCLUDE_draft: true #include draft release which is the latest commit on the main branch 
index_html: true #generate an index.html file for each rocrate
draft_folder_name: draft #name of the folder for the draft release
theme: dark #theme used for the generated pages

config.yml example 2

  1. multiple_rocrates: true
  2. RELEASE_management: false
  3. index_html: false
# config.yml
multiple_rocrates: true
RELEASE_management: false
index_html: false

Outputs

The action will generate documents for the gh-pages branch. Depending on the configuration, the action will generate a page for each rocrate in the repo, or a page for the latest release.

Outputs example

Outputs example 1

  1. multiple_rocrates: false
  2. RELEASE_management: true
  3. RELEASE_verioning: tag
  4. INCLUDE_draft: true
  5. index_html: true
# outputs
gh-pages (branch)
    - 0.1 (folder)
        - index.html
        - ro-crate-metadata.jsonld
        - ro-crate-preview.html
        - all_folders_and_files_in_repo
    - 0.2 (folder)
        - index.html
        - ro-crate-metadata.jsonld
        - ro-crate-preview.html
        - all_folders_and_files_in_repo
    - draft (folder)
        - index.html
        - ro-crate-metadata.jsonld
        - ro-crate-preview.html
        - all_folders_and_files_in_repo
    - index.html

Outputs example 2

  1. multiple_rocrates: true
  2. RELEASE_management: false
  3. index_html: false
# outputs
gh-pages (branch)
    - rocrate1 (folder)
        - index.html
        - ro-crate-metadata.jsonld
        - ro-crate-preview.html
        - all_folders_and_files_in_repo
    - rocrate2 (folder)
        - index.html
        - ro-crate-metadata.jsonld
        - ro-crate-preview.html
        - all_folders_and_files_in_repo
    - rocrate3 (folder)
        - index.html
        - ro-crate-metadata.jsonld
        - ro-crate-preview.html
        - all_folders_and_files_in_repo

License

The action and documentation in this project are released under the MIT License

rocrate-to-pages's People

Contributors

cedricdcc avatar jotafan avatar

Watchers

 avatar

rocrate-to-pages's Issues

Modifications to the crate viewer

Following the discussion on Oct 23 and following the feedback from arms-mbon/documentation#1, we have agreed to do the following:
The crate viewer you get to currently when clicking thru the ARMS data landing page (e.g. https://data.arms-mbon.org/data_workspace/latest/#./qualitycontrolled_data/) is a shock for the data-hungrey scientists. We need to lower the hurdle to them persisting with this type of view on the GH content. We will need to play around with this a bit, and separate issues for particular steps of this work are raised in here. This can be considered the parent issue to be closed when all others are done
To be more specific, issues related to this one are:

Make yml file for testing out action

The following scenario's should be tested:

good repos

  • : "Normal" repo with 1 ro-crate-metadata.json file in the root of the repo.
  • : repo with 1 ro-crate-metadata.json file in one of the subfolders of the repo.
  • : repo with multiple ro-crate-metadata.json fiiles in folders/subfolders.

bad repos

  • : repo without ro-crate-metadata.json file
  • : repo with ro-crate-metadata.json files within ro-crate-metadata.json files.
  • : repo with bad workflow.config file. These could be the following:
    - RELEASE feature enabled when repo has multiple ro-crate-metadata.json files
    - etc

Add 3 main categories

  • add main navigation
  • add breadcrumb navigation based on what is in haspart
  • categories are (URI, local files and URI's to files and blank nodes

Have extra option in the config.yml file that would allow for the end-user to give a custom name to the "draft" release folder

Currently the end-user has no controil over what the draft folder would be named.
Suggestion is to have an extra option in the config.yml file that would allow for a custom name of set folder.

TODO:

  • : Add "draft_folder_name" as a valid option in the config.yml file.
  • : Check if INCLUDE_draft is true , else give warning that option does not make sense in the config.
  • : Check if the folder name given doesn't contain any forbidden characters, else warning/change name or revert to default folder name.
  • : Include changes into the README.md

Add og:xxx to header html

Adding og:xxx and other fair signposting data to the index html and subsequent lower level versions of the crate html.

This will make the preview widget on sites like fb, LinkedIn, teams etc more informative for the end-user

delete mode

no mode but when there is a file then diplay the content otherwise display the content

change page you get to when you click on a crate from https://data.arms-mbon.org/

Currently when you click on e.g. "Data Workspace" you get first to a list of releases.
I know why we do this, but all our current users are not interested in previous versions. So for now please just go straight to the new version. We will have to think about how to go to previous versions when we have people who need to do that

Once you click on the latest version, you get to a page with the Dataset and Contextual Entitites, but that neither is wanted by our current audience, they want to go to straight to the repo itself, i.e. what you get when you click on ./ there.

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.