README.md 3.82 KB
Newer Older
1
[![Build Status](https://gitlab.com/Ma_124/awesome-framework/badges/master/build.svg)](https://gitlab.com/Ma_124/awesome-framework/commits/master)
Ma_124's avatar
Ma_124 committed
2
[![CodeCov](https://codecov.io/gl/Ma_124/awesome-framework/branch/master/graph/badge.svg)](https://codecov.io/gl/Ma_124/awesome-framework)
3
[![Go Report Card](https://goreportcard.com/badge/gitlab.com/Ma_124/awesome-framework)](https://goreportcard.com/report/gitlab.com/Ma_124/awesome-framework)
Ma_124's avatar
Ma_124 committed
4
[![CII Best Practices](https://img.shields.io/cii/level/2506.svg)](https://bestpractices.coreinfrastructure.org/en/projects/2506)
Ma_124's avatar
Ma_124 committed
5 6
[![Godoc](https://godoc.org/gitlab.com/Ma_124/awesome-framework?status.svg)](https://godoc.org/gitlab.com/Ma_124/awesome-framework)
[![License MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://ma124.js.org/l/MIT/~/2019)
7 8

# Awesome Framework
Ma_124's avatar
Ma_124 committed
9

Ma_124's avatar
Ma_124 committed
10 11
<img src="https://gitlab.com/Ma_124/pages-static-shared/raw/master/awesome-scaffolding.png" width=300>

12
This is a framework for creating [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome/blob/master/awesome.md) lists. See it in action at a [fork of awesome-go](https://ma_124.gitlab.io/awesome-go-with-framework/)
Ma_124's avatar
Ma_124 committed
13 14 15

It can convert [different filetypes](#filetypes) into each other and [fetch metadata](#fetch-metadata) about the repositories mentioned.

Ma_124's avatar
Ma_124 committed
16 17 18 19
## `awesome.yml`

`awesome.yml`:
```yaml
Ma_124's avatar
Ma_124 committed
20 21
#!/usr/bin/env awesome compile --config

Ma_124's avatar
Ma_124 committed
22 23 24 25 26 27
lists:
- input: "inplist.md"
  format: "md:list"
  outputs:
  - file:   "outlist.md"
    format: "md:table+meta"
Ma_124's avatar
Ma_124 committed
28 29
  - file:   "index.html"
    format: "html:table+meta"
Ma_124's avatar
Ma_124 committed
30 31
  - file:   "/dev/stdout"
    format: "test-alpha"
32 33 34 35 36 37
```

`post-build.awesome.sh`:
```bash
#!/bin/bash

Ma_124's avatar
Ma_124 committed
38
mkdir -p public
39 40 41 42 43 44 45 46 47 48 49 50
cp -r tmpl/** public

cat <<-EOF > public/index.html
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
    </head>
    <body>
        $(cat public/index.html)
    </body>
</html>
Ma_124's avatar
Ma_124 committed
51
EOF
52 53
```

Ma_124's avatar
Ma_124 committed
54 55
## Filetypes

Ma_124's avatar
Ma_124 committed
56
### `md:list` (Input)
Ma_124's avatar
Ma_124 committed
57 58 59 60 61 62 63 64 65 66 67

```md
+ lots
+ of
+ markdown
* [<name>](<url>) - <desc>
* [<name>](<url>) - <desc>

## Another Category
```

Ma_124's avatar
Ma_124 committed
68
TODO: describe parameters
Ma_124's avatar
Ma_124 committed
69

Ma_124's avatar
Ma_124 committed
70 71 72 73 74 75 76 77 78 79 80 81
### `tabsep` (Input/Output)

```html
"literal line
'literal without newline
" continuation of previous line
<name>\t<url>\t<desc>
"""
block literal
which spans over
multiple lines
"""
Ma_124's avatar
Ma_124 committed
82 83
```

Ma_124's avatar
Ma_124 committed
84
TODO: describe parameters
Ma_124's avatar
Ma_124 committed
85

Ma_124's avatar
Ma_124 committed
86
### `md:table` (+ `>html`) (Output)
Ma_124's avatar
Ma_124 committed
87 88 89 90 91 92 93

```md
| Name            | Desc   |
|-----------------|--------|
| [<name>](<url>) | <desc> |
```

Ma_124's avatar
Ma_124 committed
94 95 96 97 98 99 100 101 102 103 104
If you append `>html` the markdown will be compiled with [Blackfriday][].

### `md:table+meta` (+ `>html`) (Output)

```md
| Stars   | Forks   | Issues   | Last Commit   | Name            | Desc   |
|---------|---------|----------|---------------|-----------------|--------|
| <stars> | <forks> | <issues> | <last commit> | [<name>](<url>) | <desc> |
```

If you append `>html` the markdown will be compiled with [Blackfriday][].
Ma_124's avatar
Ma_124 committed
105

Ma_124's avatar
Ma_124 committed
106
### `html:table+meta` (Output)
Ma_124's avatar
Ma_124 committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122

```html
<html>
	<head>
		<meta charset="UTF-8">
	</head>
	<body>
		<main>
<table><thead><tr><th>Stars</th><th>Forks</th><th>Issues</th><th>Last Commit</th><th>Name</th><th>Desc</th></tr></thead><tbody>
<tr><td>&lt;Stars&gt;</td><td>&lt;Forks&gt;</td><td>&lt;Issues&gt;</td><td>&lt;Last Commit&gt;</td><td><a href="&lt;url&gt;">&lt;Name&gt;</a></td><td>&lt;Desc&gt;</td></tr>
</tbody></table>
		</main>
	</body>
</html>
```

Ma_124's avatar
Ma_124 committed
123

Ma_124's avatar
Ma_124 committed
124 125 126
### `test:alpha` (Test)

Tests whether the items are in alphabetically order.
Ma_124's avatar
Ma_124 committed
127 128 129 130 131 132 133 134 135 136

## Fetch Metadata

Data Sources:
* https://github.com/example/repo
* http://github.com/example/repo
* https://godoc.org/github.com/example/repo
* http://godoc.org/github.com/example/repo
* https://gitlab.com/example/repo
* http://gitlab.com/example/repo
Ma_124's avatar
Ma_124 committed
137 138
* https://godoc.org/gitlab.com/example/repo
* http://godoc.org/gitlab.com/example/repo
Ma_124's avatar
Ma_124 committed
139

140 141 142 143 144 145
Fetched Metadata:
* Stars
* Forks
* Issues
* Last Commit

Ma_124's avatar
Ma_124 committed
146 147
[Blackfriday]: https://github.com/russross/blackfriday