Skip to content

Commit

Permalink
Merge pull request #43 from metafacture/28-use-jekyll-theme
Browse files Browse the repository at this point in the history
Use jekyll theme for documentation
  • Loading branch information
fsteeg authored May 23, 2024
2 parents a3f0a22 + 035c82f commit 4241eac
Show file tree
Hide file tree
Showing 20 changed files with 393 additions and 95 deletions.
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source 'https://rubygems.org'

gem "jekyll", "~> 4.3.3" # installed by `gem jekyll`
# gem "webrick" # required when using Ruby >= 3 and Jekyll <= 4.2.2

gem "just-the-docs", "0.8.1" # pinned to the current release
# gem "just-the-docs" # always download the latest release
65 changes: 5 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,16 @@

# Metafacture Documentation

Metafacture is a toolkit for processing semi-structured data with a focus on library metadata. It provides a versatile set of tools for reading, writing and transforming data. Metafacture can be used as a stand-alone application via CLI or as a Java library in other applications. There is also a playground where you can test workflows.
Metafacture is a toolkit for processing semi-structured data with a focus on library metadata
For the documentation see: http://metafacture.github.io/metafacture-documentation/

[Have a look here for a quick intro into metafacture.](./MF-in-5-min.md)
This repo is the central place for the documentation about Metafacture that we render using the jekyll template [Just the docs](https://github.com/just-the-docs/just-the-docs).

This is the central place for the documentation about Metafacture.

Metafacture comprises three main parts: **Framework**, **Flux** and one of the **Transformation-Modules Fix and Morph**. It can be extended with modules.
The content pages can be found [here](/docs/)

> [!NOTE]
> With regard to the Transformation-Modules this documentation focusses on Fix instead of MORPH. If you want to find out more about MORPH. Have a look at [the old documentation](https://github.com/metafacture/metafacture-core/wiki/Metamorph-User-Guide) and the german cookbook by [Swissbib](https://swissbib.gitlab.io/metamorph-doku/).

Our goal with this repo is to collaboratively create comprehensive documentation on Metafacture in the [issue tracker](https://github.com/culturegraph/metafacture-documentation/issues?q=). Feel free to open issues not only for bugs or enhancements, but also questions about Metafacture usage, or to share your experiences. We hope that over time, in that way we can create useful tutorials, how-tos, and collect good practices for using Metafacture.

__________________

Deciding which parts are relevant to you depends on the way you are using Metafacture:

## Using Metafacture via playground or CLI

> [!NOTE]
> No Java-Code is necessary!!!
While working with the playground or the command line you only need [Flux](#flux) and the transformation module [Fix](#fix).
Have a look here for [Getting started](/Getting-Started.md).

## Framework for Java integration/development

If you plan to use Metafacture as a Java library or if you wish to add commands to Flux. You should get familar with the [Framework](#framework).

__________________

## FLUX

Flux is a scripting language to easily build and run processing pipelines. No Java programming is necessary - it's used as a command line. To use Flux you may download the binary distribution of Metafacture.

For more information on how to use Flux, see the [Flux User Guide](/Flux-User-Guide.md).

See [here a list for all available FLUX-Commands](/flux-commands.md).

__________________

## FIX

Metafix is a domain specific language for metadata transformation based on Catmandu FIX. The FIX object performing the transformation is used as part of a processing pipeline.

If you are using **Metafacture with CLI or Playground** and therefore the Flux scripting language to build and run pipelines, use the `fix` command in your FLUX-Pipeline.

If you are using **Metafacture as a Java library**, just create a Metafix object and add it to your pipeline (see also the [Framework User Guide](#framework)).

The transformation itself is declared in a fix-object which can be a file. For more information on how to declare transformations see [Metafix User Guide](/Fix-User-Guide.md).

See [here a list for all available FIX functions and a cookbook for using fix](/Fix-function-and-Cookbook.md).

> [!NOTE]
> PS: There is also the transformation modul MORPH. Have a look at[ the old documentation](https://github.com/metafacture/metafacture-core/wiki/Metamorph-User-Guide) and the german cookbook by [Swissbib](https://swissbib.gitlab.io/metamorph-doku/).
__________________

## Framework

> [!NOTE]
>Relevant for developers
The framework includes the interfaces and abstract classes which form the foundation of the data processing pipelines. This part of Metafacture is only relevant for you if you plan to use Metafacture as a Java library or if you wish to add pipe elements to Flux.

For more information see the [Framework User Guide](/Framework-User-Guide.md).
Our goal with this repo is to collaboratively create comprehensive documentation on Metafacture in the [issue tracker](https://github.com/metafacture/metafacture-documentation/issues?q=). Feel free to open issues not only for bugs or enhancements, but also questions about Metafacture usage, or to share your experiences. We hope that over time, in that way we can create useful tutorials, how-tos, and collect good practices for using Metafacture.

56 changes: 56 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
title: Metafacture Documentation
description: This is the central place for the documentation about Metafacture.
theme: just-the-docs

url: https://metafacture.github.io/metafacture-documentation

aux_links:
Metafacture Documentation on Github: https://github.com/metafacture/metafacture-documentation

# External navigation links
nav_external_links:
- title: LICENSE
url: https://github.com/metafacture/metafacture-core/blob/master/LICENSE

# Set a path/url to a logo that will be displayed instead of the title
logo: "/assets/images/metafacture_small.png"
favicon_ico: "/assets/images/favicon.ico"

# Footer content
# appears at the bottom of every page's main content

# Back to top link
back_to_top: true
back_to_top_text: "Back to top"

footer_content: 'Metafacture Documentation is maintained by the <a href="https://lobid.org/team-en/">Open infrastructure team of hbz.</a>'

# Footer last edited timestamp
last_edit_timestamp: true # show or hide edit time - page must have `last_modified_date` defined in the frontmatter
last_edit_time_format: "%b %e %Y at %I:%M %p" # uses ruby's time format: https://ruby-doc.org/stdlib-2.7.0/libdoc/time/rdoc/Time.html

# Custom colors, see _sass/color_schemes/metafacture.scss
color_scheme: metafacture

# see https://just-the-docs.github.io/just-the-docs/docs/search/#search-granularity
search:
heading_level: 6
previews: 6

# Callouts, see https://just-the-docs.com/docs/configuration/#callouts
callouts_level: quiet # or loud
callouts:
highlight:
color: yellow
important:
title: Important
color: blue
new:
title: New
color: green
note:
title: Note
color: purple
warning:
title: Warning
color: red
1 change: 1 addition & 0 deletions _sass/color_schemes/metafacture.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$link-color: #4183c4;
4 changes: 4 additions & 0 deletions _sass/custom/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
h4 {font-size: 1rem !important;}
h5 {
font-size: 1.5rem !important;
}
Binary file added assets/images/favicon.ico
Binary file not shown.
Binary file added assets/images/metafacture_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
layout: default
title: Approaching a transformation with metafacture
nav_order: 4
---

Every approach to transform metadata with metafacture is quite similiar:

- You need to know the type and source of the input and the type and destination of the output:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
---
layout: default
title: Maintainer Guide
nav_order: 8
---

## how to change flux-commands.md
# Maintainer Guide

The entries in flux-commands.md describe the usage of commands used by flux.
## how to change [docs/flux/flux-commands.md](https://github.com/metafacture/metafacture-documentation/blob/28-use-jekyll-theme/docs/flux/flux-commands.md)

The entries in [docs/flux/flux-commands.md](https://github.com/metafacture/metafacture-documentation/blob/28-use-jekyll-theme/docs/flux/flux-commands.md) describe the usage of commands used by flux.
flux-commands.md is fully automatically generated. To make this happen one has to
fill in the proper annotations in the correponding java classes. E.g.

Expand Down Expand Up @@ -30,7 +37,7 @@ The option's name is produced by cutting away the "set" from the methods name, l
"BatchSize" which is then lowercased. The parameter of this option is generated from the
parameter type of the method - here an "int"eger.

## how to publish flux-commands.md
## how to publish [docs/flux/flux-commands.md](https://github.com/metafacture/metafacture-documentation/blob/28-use-jekyll-theme/docs/flux/flux-commands.md)

If you have updated some of these annotations, say "description", and these changes are
merged into the master branch, generate a new flux-commands.md like this:
Expand All @@ -43,6 +50,7 @@ $ flux.sh > flux-commands.md
```

Open the generated flux-commands.md and remove some boilerplate at the beginning of the
file manually. Save it, copy it here, commit and push.
file manually. Add the naviagtion part of the page, save it, copy it [here](https://github.com/metafacture/metafacture-documentation/blob/28-use-jekyll-theme/docs/flux/flux-commands.md), commit and push.


The [publishing process will be automated with an github action](https://github.com/metafacture/metafacture-core/issues/368).
19 changes: 11 additions & 8 deletions Getting-Started.md → docs/Getting-Started.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
![logo](https://github.com/culturegraph/metafacture-core/wiki/img/metafacture_small.png)

---
layout: default
title: Getting Started
nav_order: 2
---

# Getting started!

## Playground

The easiest way to get started with Metafacture is the Playground. Take a look at the [first example](https://metafacture.org/playground/?example=encode-xml) and run it by pressing the !["Process"](https://metafacture.org/img/process.png) button. Check out the other examples (first button, !["Load Examples"](https://metafacture.org/img/load-exmples.png)) for different input sources, transformations, and output formats.

For commands available in the Flux, see [the Flux commands documentation](/flux-commands.md).
For commands available in the Flux, see [the Flux commands documentation](flux/flux-commands.html).

For functions and usage of the Fix, see [the Fix functions and cookbook](/Fix-functions-and-cookbook).
For functions and usage of the Fix, see [the Fix functions and cookbook](fix/Fix-functions-and-Cookbook.html).

For next steps get familar with [FLUX](/Flux-User-Guide.md) and [FIX](/Fix-User-Guide.md). And try out some Metafacture workflows.
For next steps get familar with [FLUX](flux/Flux-User-Guide.html) and [FIX](fix/Fix-User-Guide.html). And try out some Metafacture workflows.

## Command line

Expand All @@ -22,9 +25,9 @@ To use Metafacture as a command-line tool, download the latest metafix-runner fr

To get started, you can export a workflow from the Playground (last button, !["Export Workflow"](https://metafacture.org/img/export.png)).

To set up IDE support for editing your Flux and Fix files, see [the IDE extensions page](https://metafacture.org/ide-extensions/index.html).
To set up IDE support for editing your Flux and Fix files, see [the IDE extensions page](https://metafacture.org/ide-extensions.html).

For next steps get familar with [FLUX](/Flux-User-Guide.md) and [FIX](/Fix-User-Guide.md). And try out some Metafacture workflows.
For next steps get familar with [FLUX](flux/Flux-User-Guide.html) and [FIX](fix/Fix-User-Guide.html). And try out some Metafacture workflows.

## Using Metafacture as a Java library

Expand Down Expand Up @@ -55,4 +58,4 @@ To use Fix you would declare `metafix` instead of `metafacture-io` as in the exa
Occasionally, we publish snapshot builds on [Sonatype OSS Repository](https://oss.sonatype.org/index.html#nexus-search;gav~org.metafacture~~~~~kw,versionexpand). The version number is derived from the branch name. Snapshot builds from the master branch always have the version `master-SNAPSHOT`. We also provide sometimes pre releases as github packages.


If you plan to use Metafacture as a Java library or if you wish to add commands to Flux you should get familar with the [Framework](/Framework-User-Guide.md).
If you plan to use Metafacture as a Java library or if you wish to add commands to Flux you should get familar with the [Framework](java-integration/Framework-User-Guide.html).
12 changes: 9 additions & 3 deletions MF-in-5-min.md → docs/MF-in-5-min.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
layout: default
title: 5 min Intro into MF
nav_order: 3
---

# Introduction - A quick 5 minute introduction to Metafacture

## HELLO WORLD
Expand Down Expand Up @@ -87,7 +93,7 @@ $ cat yaml2json.flux

## FIX LANGUAGE

Many data conversions need a mapping from one field to another field plus optional conversions of the data inside these fields. Metafacture provides the transformation module `fix` that uses the Catmandu-inspired Fix language to assist in these mappings. A full list Fix functions is available at https://github.com/metafacture/metafacture-documentation/blob/master/Fix-function-and-Cookbook.md#functions.
Many data conversions need a mapping from one field to another field plus optional conversions of the data inside these fields. Metafacture provides the transformation module `fix` that uses the Catmandu-inspired Fix language to assist in these mappings. See the [full list of Fix functions](fix/Fix-functions-and-Cookbook.html#functions).

Fixes can be provided inline as text argument of the fix module in the Flux script, or as a pointer to a Fix script. A Fix script groups one or more fixes in a file.

Expand Down Expand Up @@ -173,6 +179,6 @@ The 245 field with its subfields of each MARC record is mapped to the title fiel
The `retain` Fix function keeps only the title field in the output. (In contrast to Catmandu there are no special marc or pica fixes since the internal handling of records and elements is more generic. Also the internal serialization of MARC is not as complex as in Catmandu.)


Now you should be ready to [get started](./Getting-Started.md).
Now you should be ready to [get started](Getting-Started.html).

(Note: This mini introduction to Metafacture is inspired by the mini introduction to Catmandu here: https://metacpan.org/dist/Catmandu/view/lib/Catmandu/Introduction.pod)
(Note: This mini introduction to Metafacture is inspired by the mini [introduction to Catmandu](https://metacpan.org/dist/Catmandu/view/lib/Catmandu/Introduction.pod))
11 changes: 8 additions & 3 deletions Fix-User-Guide.md → docs/fix/Fix-User-Guide.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
![logo](https://github.com/culturegraph/metafacture-core/wiki/img/metafacture_small.png)
---
layout: default
title: Fix User Guide
parent: Fix
nav_order: 1
---

# Fix User Guide

This document provides an introduction to the Metafacture Fix language (short: Metafix or Fix). The Fix language for Metafacture is introduced as an alternative to configuring data transformations with Metamorph. Inspired by Catmandu Fix, Metafix processes metadata not as a continuous data stream but as discrete records.

## Part of a metafacture worflow
Metafacture Fix is a transformation module that can be used in a [Flux Workflow](/Flux-User-Guide.md), for this you have to use this in your pipeline:
Metafacture Fix is a transformation module that can be used in a [Flux Workflow](../flux/Flux-User-Guide.html), for this you have to use this in your pipeline:

Flux-Example:
```PERL
Expand Down Expand Up @@ -85,7 +90,7 @@ do Bind(params,…)
end
```

Find here a [list of all functions, selectors, binds and conditionals](/Fix-function-and-Cookbook.md).
Find here a [list of all functions, selectors, binds and conditionals](Fix-functions-and-Cookbook.html).


## Addressing Pieces of Data: FIX-Path and the record structure in FIX
Expand Down
Loading

0 comments on commit 4241eac

Please sign in to comment.