Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Varia #1001

Merged
merged 3 commits into from
Dec 30, 2024
Merged

Varia #1001

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ enola_maven.install(
"ch.vorburger.exec:exec:3.1.5",
"com.github.java-json-tools:uri-template:0.10",
"info.picocli:picocli:4.7.5",
"org.snakeyaml:snakeyaml-engine:2.7",
"org.yaml:snakeyaml:2.2",
"org.snakeyaml:snakeyaml-engine:2.8",
"org.yaml:snakeyaml:2.3",
"org.slf4j:slf4j-jdk14:2.0.16",
"org.slf4j:slf4j-simple:2.0.16",
# Tika (unfortunately!) uses Log4j (v2) instead of SLF4j, so:
Expand Down
2 changes: 2 additions & 0 deletions ToDo.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

## High Priority (Next Features)

1. Focus on implementing _Applications_ outlined in [`mkdocs.yaml`](mkdocs.yaml)

1. Merge this with [`ToDo.yaml`](ToDo.yaml)

1. Support top-level `namespace: "demo"` in `docs/use/library/model.textproto` and rm others
Expand Down
1 change: 1 addition & 0 deletions ToDo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ items:

- Exec Connector!:
tags: [exec]
description: "Consider adopting Camel?!"
links:
- https://camel.apache.org/components/4.4.x/exec-component.html

Expand Down
45 changes: 40 additions & 5 deletions docs/use/fetch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ This is different from [`get`](../get/index.md), which shows _Things_ given an _
Enola supports the [URI schemes](https://en.wikipedia.org/wiki/List_of_URI_schemes) which are documented below.
These are supported everywhere; including in `fetch`, `--load`, and elsewhere.

## HTTP
## Schemes

### HTTP

This will fetch <https://www.vorburger.ch/hello.md>: _(Note how for security reasons we have to explicitly permit it.)_

Expand All @@ -37,7 +39,7 @@ $ ./enola fetch --http-scheme https://www.vorburger.ch/hello.md

Enola locally caches HTTP responses on the filesystem.

## Files
### Files

We can do `cat`-like equivalent of local files using [the `file:` scheme](https://en.wikipedia.org/wiki/File_URI_scheme):

Expand All @@ -55,14 +57,14 @@ $ ./enola fetch /tmp/hi.txt
...
```

## Classpath
### Classpath

```bash cd ../.././..
$ ./enola fetch classpath:/VERSION
...
```

## Data
### Data

Enola [supports (RFC 2397) `data:` URLs](https://en.m.wikipedia.org/wiki/Data_URI_scheme):

Expand All @@ -71,7 +73,7 @@ $ ./enola fetch "data:application/json;charset=UTF-8,%7B%22key%22%3A+%22value%22
...
```

## Empty
### Empty

`empty:` is a (non-standard) URL scheme in Enola for "no content" (as an alternative to `data:,`):

Expand All @@ -80,6 +82,39 @@ $ ./enola fetch empty:/
...
```

### Exec (TODO)

We plan to support an `exec:` scheme, whose content will be the resulting of running the given command,
similar to e.g. [🐪 Camel's](https://camel.apache.org/components/4.8.x/exec-component.html) or (vaguely) Web Browsers'
`javascript:`.

<!-- TODO ### Git `git:` ? -->

## Parameters

Enola considers certain generic query parameters in URLs it fetches.

These work with most but not all schemes (e.g. `data:` does not permit query parameters).

### Media Type

Adding e.g. `?mediaType=application/json` [overrides the Media Type](../info/index.md#detect)
which e.g. a server provided in e.g. a HTTP header,
or that was determined from a file extension.

### Charset

Adding e.g. `?charset=iso-8859-1` overrides (and takes precedence over)
the Charset from the Media Type (if any) or any HTTP header like mechanisms.

### Integrity (TODO)

We plan
to support `?integrity=...`
to verify resource integrity via a [cryptographic digest ("hash")])(https://docs.ipfs.tech/concepts/hashing/)
using a [Multiformats's Multibase encoded Multihash](https://www.multiformats.io).
This is similar e.g. to [HTML's Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity).

<!--
## Screencast
Expand Down
5 changes: 5 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
<artifactId>snakeyaml-engine</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
Expand Down
5 changes: 2 additions & 3 deletions learn/jbang/hello.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
* limitations under the License.
*/

//JAVA 21
//COMPILE_OPTIONS --enable-preview -source 21
//RUNTIME_OPTIONS --enable-preview
//JAVA 21+
//PREVIEW
//DEPS dev.enola:enola:0.0.1-SNAPSHOT

import static java.lang.System.out;
Expand Down
16 changes: 8 additions & 8 deletions maven_install.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": -479701467,
"__RESOLVED_ARTIFACTS_HASH": 1492391959,
"__INPUT_ARTIFACTS_HASH": 1498010693,
"__RESOLVED_ARTIFACTS_HASH": 1019550415,
"conflict_resolution": {
"com.fasterxml.jackson.core:jackson-databind:2.13.5": "com.fasterxml.jackson.core:jackson-databind:2.17.2"
},
Expand Down Expand Up @@ -1338,10 +1338,10 @@
},
"org.snakeyaml:snakeyaml-engine": {
"shasums": {
"jar": "4053f878c171692aab8782f53a3974f43e55e2b6ed12c3682b36a46968c5ded1",
"sources": "02572a2ab02d8507b6b2291857d909fa901a01e5b47867897d69df5db8897169"
"jar": "32571d6e539f1794a1cdfc8b2f656e14387a39635202e389af05509e52916720",
"sources": "18a19d37d92a9a73e329f1520922c823e7cad86c5d3faa1b36b38b5cad62df34"
},
"version": "2.7"
"version": "2.8"
},
"org.tallison:jmatio": {
"shasums": {
Expand All @@ -1359,10 +1359,10 @@
},
"org.yaml:snakeyaml": {
"shasums": {
"jar": "1467931448a0817696ae2805b7b8b20bfb082652bf9c4efaed528930dc49389b",
"sources": "8f7cf911cf63db55fd980a926d155bd846317737351a2f48ef1c1088c414538a"
"jar": "63a76fe66b652360bd4c2c107e6f0258daa7d4bb492008ba8c26fcd230ff9146",
"sources": "127d0e66b80324f65821451827affb8c2f70914f0d7b7b0cb99d56d12e9901cc"
},
"version": "2.2"
"version": "2.3"
}
},
"dependencies": {
Expand Down
6 changes: 5 additions & 1 deletion mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ copyright: Copyright &copy; 2023-2024 The Enola <https://enola.dev> Authors

nav:
# - Applications:
# - Bookmarks: (delicious.json, bookmarks.html, awesome.yaml; Graph, HTML, Timeline)
# - Bookmark: (delicious.json, bookmarks.html, awesome.yaml; Graph, HTML, Timeline)
# - Awesome List: # https://awesomes.directory/
# - Genealogy:
# - GitHub:
# - ToDo:
# - Tech Infra
# - Networking:
# - Linux:
Expand Down
Loading