Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit e2b9947

Browse files
committed
Added documentation
1 parent 5899927 commit e2b9947

File tree

4 files changed

+124
-5
lines changed

4 files changed

+124
-5
lines changed

project/diec/documentation/index.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,56 @@ <h1>diec</h1>
4545
<a href="https://d-i-projects.github.io/project/diec/documentation"><button>Documentation</button></a>
4646
</div>
4747
<div class="page-content">
48+
<div class="content">
49+
<h1>Diec Encoding and Decoding Tutorial</h1>
50+
51+
<h2>Encode</h2>
52+
<pre><code>from diec.encoder import encode
53+
54+
encode("I love python and I love to learn new things here too! &lt;3")
55+
</code></pre>
56+
<h3>Output</h3>
57+
<p>The Key you created: <a class="better-link" href="https://github.com/D-I-Projects/diec/blob/main/diec_example/key.diec">key.diec</a></p>
58+
<p>The encoded text: <a class="better-link" href="https://github.com/D-I-Projects/diec/blob/main/diec_example/encoded.diec">encoded.diec</a></p>
59+
<p><strong>Both of them will appear in your current directory</strong></p>
60+
<hr>
61+
62+
<h2>Decode</h2>
63+
<pre><code>from diec.decoder import decode
64+
65+
decode() # The key.diec and encoded.diec files have to be in the same directory as the file that runs this command.
66+
</code></pre>
67+
<h3>Output</h3>
68+
<pre><code>I love python and I love to learn new things here too! &lt;3
69+
</code></pre>
70+
<hr>
71+
72+
<h2>CLI Tutorial</h2>
73+
<p>The Diec CLI (Command Line Interface) allows you to easily encode and decode text via the terminal.</p>
74+
75+
<h3>Installation</h3>
76+
<p>Make sure Diec is installed:</p>
77+
<pre><code>pip install diec
78+
</code></pre>
79+
80+
<h3>Using the CLI</h3>
81+
<p>After installation, you can use the following commands:</p>
82+
83+
<h4>1. <strong>Encode Text</strong>:</h4>
84+
<p>To encode a text, use the <code>encode_cli</code> command. Provide the desired text in quotes:</p>
85+
<pre><code>python -m diec encode-cli "Your text here"
86+
</code></pre>
87+
<p><strong>Example</strong>:</p>
88+
<pre><code>python -m diec encode-cli "I love Python and learning new things! &lt;3"
89+
</code></pre>
90+
<p>After running this command, a key file <code>key.diec</code> and an encoded file <code>encoded.diec</code> will be created in your current directory.</p>
91+
92+
<h4>2. <strong>Decode Text</strong>:</h4>
93+
<p>To decode an encoded text, use the <code>decode_cli</code> command:</p>
94+
<pre><code>python -m diec decode-cli
95+
</code></pre>
96+
<p>Make sure that the <code>key.diec</code> and <code>encoded.diec</code> files are in the same directory as the script you run.</p>
97+
</div>
4898
<footer>
4999
<div class="footer-container">
50100
<div class="footer-left">

project/diec/documentation/style_project_diec.css

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ b {
104104
transition: color 0.3s ease;
105105
}
106106

107+
.table-link {
108+
color: var(--text-color);
109+
text-decoration: solid;
110+
}
111+
107112
.black:hover {
108113
color: var(--link-hover-color);
109114
}
@@ -151,8 +156,8 @@ body.light-mode .program_table tr:hover {
151156
}
152157

153158
pre {
154-
background-color: #282c34;
155-
color: #abb2bf;
159+
background-color: var(--header-color);
160+
color: var(--bg-color);
156161
border-radius: 5px;
157162
padding: 10px;
158163
overflow-x: auto;
@@ -357,12 +362,76 @@ pre code {
357362
box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
358363
}
359364

365+
.table_t table {
366+
width: 750px;
367+
border-radius: 20px;
368+
border-collapse: collapse;
369+
background-color: var(--bg-color);
370+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
371+
margin: 20px auto;
372+
color: var(--text-color);
373+
}
374+
375+
.table_t th,
376+
.table_t td {
377+
padding: 12px 20px;
378+
text-align: left;
379+
}
380+
381+
.table_t table th {
382+
background-color: var(--secondary-color);
383+
color: var(--header-color);
384+
font-size: 22px;
385+
font-weight: bold;
386+
position: sticky;
387+
top: 0;
388+
z-index: 2;
389+
}
390+
391+
.table_t table tr {
392+
font-size: 20px;
393+
}
394+
395+
.table_t table tr:nth-child(even) {
396+
background-color: var(--table-alt-row-color);
397+
}
398+
399+
.table_t table tr:hover {
400+
background-color: var(--hover-bg-color);
401+
transition: background-color 0.3s ease;
402+
}
403+
404+
.table_t table tr:first-child th:first-child {
405+
border-top-left-radius: 20px;
406+
}
407+
408+
.table_t tr:first-child th:last-child {
409+
border-top-right-radius: 20px;
410+
}
411+
412+
.table_t table tr:last-child td:first-child {
413+
border-bottom-left-radius: 20px;
414+
}
415+
416+
.table_t table tr:last-child td:last-child {
417+
border-bottom-right-radius: 20px;
418+
}
419+
420+
.content {
421+
top: 0px;
422+
padding: 10px;
423+
}
424+
425+
.better-link {
426+
text-decoration: none;
427+
color: var(--text-color);
428+
}
429+
360430
footer {
361431
display: block;
362432
background-color: var(--bg-color);
363433
color: var(--text-color);
364434
padding: 20px 0;
365-
position: absolute;
366435
}
367436

368437
.footer-container {

project/diec/version-history/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h1>diec</h1>
4545
<a href="https://d-i-projects.github.io/project/diec/documentation"><button>Documentation</button></a>
4646
</div>
4747
<div class="page-content">
48-
<div class="overview">
48+
<div class="content">
4949
<h1>Version History</h1>
5050
<p>This Software is licensed under the Open Source MIT License.</p>
5151
<p>All downloads you find here are the same as the ones you would find in our GitHub and not modified.</p>

project/diec/version-history/style_project_diec.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ pre code {
417417
border-bottom-right-radius: 20px;
418418
}
419419

420-
.overview {
420+
.content {
421421
top: 0px;
422422
padding: 10px;
423423
}

0 commit comments

Comments
 (0)