Skip to content

Commit

Permalink
chore: add basic config for cargo-about
Browse files Browse the repository at this point in the history
Currently this is basically the default config generated with 'cargo
about init'. Later the template could probably be adjusted to allow to
display those license nativaly in iced.
  • Loading branch information
maximmaxim345 committed May 24, 2024
1 parent cc131c2 commit 380c838
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
70 changes: 70 additions & 0 deletions about.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<html>

<head>
<style>
@media (prefers-color-scheme: dark) {
body {
background: #333;
color: white;
}
a {
color: skyblue;
}
}
.container {
font-family: sans-serif;
max-width: 800px;
margin: 0 auto;
}
.intro {
text-align: center;
}
.licenses-list {
list-style-type: none;
margin: 0;
padding: 0;
}
.license-used-by {
margin-top: -10px;
}
.license-text {
max-height: 200px;
overflow-y: scroll;
white-space: pre-wrap;
}
</style>
</head>

<body>
<main class="container">
<div class="intro">
<h1>Third Party Licenses</h1>
<p>This page lists the licenses of the projects used in cargo-about.</p>
</div>

<h2>Overview of licenses:</h2>
<ul class="licenses-overview">
{{#each overview}}
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
{{/each}}
</ul>

<h2>All license text:</h2>
<ul class="licenses-list">
{{#each licenses}}
<li class="license">
<h3 id="{{id}}">{{name}}</h3>
<h4>Used by:</h4>
<ul class="license-used-by">
{{#each used_by}}
<li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li>
{{/each}}
</ul>
<pre class="license-text">{{text}}</pre>
</li>
{{/each}}
</ul>
</main>
</body>

</html>
13 changes: 13 additions & 0 deletions about.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
accepted = [
"MIT",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"BSL-1.0",
"Unicode-DFS-2016",
"BSD-3-Clause",
"BSD-2-Clause",
"Zlib",
"ISC",
"CC0-1.0",
"AGPL-3.0",
]

0 comments on commit 380c838

Please sign in to comment.