Skip to content

Commit

Permalink
1.2.0-stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZhou authored Jun 7, 2022
1 parent e732c5f commit 2702036
Show file tree
Hide file tree
Showing 26 changed files with 886 additions and 0 deletions.
600 changes: 600 additions & 0 deletions D2Lib.py

Large diffs are not rendered by default.

Binary file added d2lib/d2lib/!$photo/banner-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added d2lib/d2lib/!$photo/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added d2lib/d2lib/!$photo/github.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added d2lib/d2lib/!$photo/icon-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added d2lib/d2lib/!$photo/old-favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions d2lib/d2lib/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 404 Page not found
***
We can`t find the page you are looking for!

[Back to Home page](/home.md)
33 changes: 33 additions & 0 deletions d2lib/d2lib/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<center>
![icon](!$photo/banner-dark.png)
</center>

# Home
Welcome to D2Lib!

D2Lib(2 doc types' library) is an online library support *.html* files and *.md* files
***

[D2Lib on GitHub <img alt="github" height="25" src="!$photo/github.gif" width="25"/>](https://github.com/ArthurZhou/D2Lib)

![badge1](https://img.shields.io/github/issues/ArthurZhou/D2Lib?style=for-the-badge)
![badge2](https://img.shields.io/github/forks/ArthurZhou/D2Lib?style=for-the-badge)
![badge3](https://img.shields.io/github/stars/ArthurZhou/D2Lib?style=for-the-badge)
![badge4](https://img.shields.io/github/license/ArthurZhou/D2Lib?style=for-the-badge)

## Info
Start your journey here
## Content
[What's new?](Update log.md)

[Readme](Readme.md)

[Plain text file](docs/txt.txt)

[rtf file](docs/rtf.rtf)

[jpg file](docs/favicon.jpg)

[mp4 file](docs/mp4.mp4)

[A *.html* example for this page](home.html)
25 changes: 25 additions & 0 deletions d2lib/d2lib/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Readme
A Python tool that provides online libraries. Supported markdown and html files.

Tip: While you are using a .md file, the page's title is same as your file name(*.md* and *.html* will be removed)!

## Built-in NAT LICENSE (if you are going to download 1.0.0-beta6 or later, please read it)
[View it here](https://github.com/ArthurZhou/D2Lib/wiki/Bulit-in-NAT-LICENSE)

## What is D2Lib
D2Lib(2 doc types' library) is a lite weight tool for you to open a doc centre easily. It supports .md and .html file.

## Installations
Hi there! Thank you for choose this project!

Before you download anything, you need to know that you only need to download .py file.All .md, .html, .css or .sh file are not required when running the programme!

[Check out on wiki page](https://github.com/ArthurZhou/D2Lib/wiki/Installations)

## Runtime
[Python3.7.2](https://www.python.org/downloads/release/python-372/)

We only have source releases now, because it'll be easier for you to change options and docs.And, nobody wants to run a packed application on his/her server, I think :)

## License
GPL-3.0
5 changes: 5 additions & 0 deletions d2lib/d2lib/Update log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# update log for 1.2.0-beta5

1. Enchantment for executable running
2. Official executable file
3. Fix a ton of bugs
7 changes: 7 additions & 0 deletions d2lib/d2lib/block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# The server reject your request!
***
You saw this page because you are trying to open this page by server ip.
But this site doesn't support it!

### What can I do?
You can ask your service provider, network administrator or someone who give you this ip for a domain.
1 change: 1 addition & 0 deletions d2lib/d2lib/docs/Hello world!.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This is a book
11 changes: 11 additions & 0 deletions d2lib/d2lib/docs/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Docs on this site
## Books
[Hello world!](Hello world!.md)

[Plain text file](txt.txt)

[rtf file](rtf.rtf)

[jpg file](favicon.jpg)

[mp4 file](mp4.mp4)
Binary file added d2lib/d2lib/docs/favicon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added d2lib/d2lib/docs/mp4.mp4
Binary file not shown.
18 changes: 18 additions & 0 deletions d2lib/d2lib/docs/rtf.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;}
{\colortbl;\red255\green255\blue255;\red251\green2\blue7;\red255\green255\blue10;\red251\green2\blue7;
\red0\green0\blue255;\red33\green255\blue6;\red127\green127\blue127;}
{\*\expandedcolortbl;;\cssrgb\c100000\c14913\c0;\cssrgb\c99942\c98555\c0;\cssrgb\c100000\c14913\c0;
\cssrgb\c1680\c19835\c100000;\cssrgb\c0\c97680\c0;\cssrgb\c57046\c57047\c57046;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\b\fs36 \cf0 This is a rtf formatted file\
\
\cf2 COLORED TEXT\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf3 COLORED TEXT\cf4 \
\cf5 COLORED TEXT\cf4 \
\cf6 COLORED TEXT\cf4 \
\cf7 COLORED TEXT\cf0 \
}
3 changes: 3 additions & 0 deletions d2lib/d2lib/docs/txt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a plain text file

--end--
Binary file added d2lib/d2lib/favicon.ico
Binary file not shown.
19 changes: 19 additions & 0 deletions d2lib/d2lib/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
</head>
<body>
<h1>Home</h1>
<p>Welcome to D2Lib!<br>D2Lib(2 doc types' library) is an online library support *.html* files and *.md* files</p>
<h2>Info</h2>
<p>Start your journey here</p>
<h2>Content</h2>
<a href="Update log.md">What's new?</a>
<br><br>
<a href="Readme.md">Readme</a>
<br><br>
<a href="Home.md">A <strong>.md</strong> example for this page</a>
</body>
</html>
6 changes: 6 additions & 0 deletions d2lib/d2lib/show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# D2Lib
Welcome to YOUR OWN DOCUMENT LIBRARY !
<br>
Use D2Lib to share Documents, publish books or even make a wiki page(not suggested :D)
<br>
Our official GitHub page: [https://github.com/ArthurZhou/D2Lib](https://github.com/ArthurZhou/D2Lib)
1 change: 1 addition & 0 deletions d2lib/d2lib/wiki/file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a file.
5 changes: 5 additions & 0 deletions d2lib/d2lib/wiki/home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Wiki
This is a wiki page. You can also sign a domain like `wiki.d2lib.com` to visit this site.

## Content
[A file](file.md)
46 changes: 46 additions & 0 deletions d2lib/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{name}}</title>
<style>
body{background-color:#292929;}
@keyframes fadeInAnimation {0% {opacity:0;} 100% {opacity:1;}}
div {margin: 20px; padding: 10px;}
hr {border-top: 5px solid#c3c3c3; border-bottom-width: 0; border-left-width: 0; border-right-width: 0; border-radius: 3px;}
h1 {color: #c3c3c3; font-family: Arial,serif; font-size: 250%; text-align: center; letter-spacing:3px;}
h2 {color: #c3c3c3; font-family: Arial,serif; font-size: 220%; text-align: center; letter-spacing:3px;}
h3 {color: #c3c3c3; font-family: Arial,serif; font-size: 190%; text-align: center; letter-spacing:3px;}
h4 {color: #c3c3c3; font-family: Arial,serif; font-size: 170%; text-align: center; letter-spacing:3px;}
h5 {color: #c3c3c3; font-family: Arial,serif; font-size: 150%; text-align: center; letter-spacing:3px;}
h6 {color: #c3c3c3; font-family: Arial,serif; font-size: 130%; text-align: center; letter-spacing:3px;}
code{color: #c8c8c8; font-family: Courier New,serif;}
a {text-decoration: None; color: #58748d; font-family: sans-serif; letter-spacing:1px;}a:link,
a:visited {color: #58748d;}
a:hover {color: #539899; text-decoration:none;}
a:active {color: #c3c3c3; background: #101010;}
p {color: #c3c3c3; font-family: Helvetica,serif;font-size: 100%; display: inline; text-indent: 100px; letter-spacing:1px; line-height:120%;}
p.warn {color: #e33a3a; font-family: Helvetica,serif;font-size: 100%; display: inline; text-indent: 100px; letter-spacing:1px; line-height:120%;}
ul {list-style-type: square; font-family: Helvetica,serif; color: #c3c3c3;}ol{font-family: Helvetica,serif; color: #c3c3c3;}
table {border: 2px solid #101010; font-family: Helvetica,serif;}
th {border: 1px solid #101010; font-family: Helvetica,serif; color: #c3c0c3; font-weight: bold; text-align: center; padding: 10px;}
td {font-family: Helvetica,serif; color: #c3c3c3; text-align: center; padding: 2px;}
input {color: #c3c3c3; font-family: Helvetica,serif; background: #101010; border-top-width: 0; border-bottom-width: 0; border-left-width: 0; border-right-width: 0; height: 20px; width: 200px;}
div.fade {animation: fadeInAnimation ease 0.3s; animation-iteration-count: 1;animation-fill-mode: forwards;}
ul.menu {list-style-type: none;margin:0;padding: 0;overflow: hidden;background-color: #333;}
li.menu {float: left;}
li.logout {float: right;}
li.menu a {display: block;color: white;text-align: center;padding: 14px 16px; text-decoration: none;}
li.menu a:hover {background-color: #111;}
li.logout a {display: block;color: #958a4b;text-align: center;padding: 14px 16px; text-decoration: none;}
li.logout a:hover {background-color: #111;}
</style>
</head>
<body>
<div><ul class="menu">{{content|safe}}</ul></div>
<div class="fade">
{{text|safe}}
</div>
<div><br><hr><p>Powered by D2Lib</p></div>
</body>
</html>
57 changes: 57 additions & 0 deletions d2lib/templates/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
<style>
body{background-color:#292929;}
@keyframes fadeInAnimation {0% {opacity:0;} 100% {opacity:1;}}
div {margin: 20px; padding: 10px;}
hr {border-top: 5px solid#c3c3c3; border-bottom-width: 0; border-left-width: 0; border-right-width: 0; border-radius: 3px;}
h1 {color: #c3c3c3; font-family: Arial,serif; font-size: 250%; text-align: center; letter-spacing:3px;}
h2 {color: #c3c3c3; font-family: Arial,serif; font-size: 220%; text-align: center; letter-spacing:3px;}
h3 {color: #c3c3c3; font-family: Arial,serif; font-size: 190%; text-align: center; letter-spacing:3px;}
h4 {color: #c3c3c3; font-family: Arial,serif; font-size: 170%; text-align: center; letter-spacing:3px;}
h5 {color: #c3c3c3; font-family: Arial,serif; font-size: 150%; text-align: center; letter-spacing:3px;}
h6 {color: #c3c3c3; font-family: Arial,serif; font-size: 130%; text-align: center; letter-spacing:3px;}
code{color: #c8c8c8; font-family: Courier New,serif;}
a {text-decoration: None; color: #58748d; font-family: sans-serif; letter-spacing:1px;}a:link,
a:visited {color: #58748d;}
a:hover {color: #539899; text-decoration:none;}
a:active {color: #c3c3c3; background: #101010;}
p {color: #c3c3c3; font-family: Helvetica,serif;font-size: 100%; display: inline; text-indent: 100px; letter-spacing:1px; line-height:120%;}
p.warn {color: #e33a3a; font-family: Helvetica,serif;font-size: 100%; display: inline; text-indent: 100px; letter-spacing:1px; line-height:120%;}
ul {list-style-type: square; font-family: Helvetica,serif; color: #c3c3c3;}ol{font-family: Helvetica,serif; color: #c3c3c3;}
table {border: 2px solid #101010; font-family: Helvetica,serif;}
th {border: 1px solid #101010; font-family: Helvetica,serif; color: #c3c0c3; font-weight: bold; text-align: center; padding: 10px;}
td {font-family: Helvetica,serif; color: #c3c3c3; text-align: center; padding: 2px;}
input {color: #c3c3c3; font-family: Courier,serif; background: #101010; border-top-width: 0; border-bottom-width: 2px; border-left-width: 0; border-right-width: 0; height: 30px; width: 500px; font-size: 15px;}
div.fade {animation: fadeInAnimation ease 0.3s; animation-iteration-count: 1;animation-fill-mode: forwards;}
</style>
</head>
<body>
{% if msg %}
<div>
{% else %}
<div class="fade">
{% endif %}
<h1>Login to access this site</h1>
<p>No idea about username and password? Go and ask your service provider.</p><br>
<a href="/">I think I`ve already logged in -></a>
<hr>
<center>
<form method="post">
<label>
<input type="text" name="user" >
</label><br>
<label>
<input type="password" name="psw" >
</label><br>
<input type="submit" name="Login"><br><br>
<p class="warn">{{msg}}</p>
</form>
</center>
<br><p>Powered by D2Lib</p>
</div>
</body>
</html>
30 changes: 30 additions & 0 deletions d2lib/templates/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
body{background-color:#292929;}
@keyframes fadeInAnimation {0% {opacity:0;} 100% {opacity:1;}}
div {margin: 20px; padding: 10px;}
hr {border-top: 5px solid#c3c3c3; border-bottom-width: 0; border-left-width: 0; border-right-width: 0; border-radius: 3px;}
h1 {color: #c3c3c3; font-family: Arial,serif; font-size: 250%; text-align: center; letter-spacing:3px;}
h2 {color: #c3c3c3; font-family: Arial,serif; font-size: 220%; text-align: center; letter-spacing:3px;}
h3 {color: #c3c3c3; font-family: Arial,serif; font-size: 190%; text-align: center; letter-spacing:3px;}
h4 {color: #c3c3c3; font-family: Arial,serif; font-size: 170%; text-align: center; letter-spacing:3px;}
h5 {color: #c3c3c3; font-family: Arial,serif; font-size: 150%; text-align: center; letter-spacing:3px;}
h6 {color: #c3c3c3; font-family: Arial,serif; font-size: 130%; text-align: center; letter-spacing:3px;}
code{color: #c8c8c8; font-family: Courier New,serif;}
a {text-decoration: None; color: #58748d; font-family: sans-serif; letter-spacing:1px;}
a:link, a:visited {color: #58748d;}
a:hover {color: #539899; text-decoration:none;}
a:active {color: #c3c3c3; background: #101010;}
p {color: #c3c3c3; font-family: Helvetica,serif;font-size: 100%; display: inline; text-indent: 100px; letter-spacing:1px; line-height:120%;}
p.warn {color: #e33a3a; font-family: Helvetica,serif;font-size: 100%; display: inline; text-indent: 100px; letter-spacing:1px; line-height:120%;}
ul {list-style-type: square; font-family: Helvetica,serif; color: #c3c3c3;}ol{font-family: Helvetica,serif; color: #c3c3c3;}
table {border: 2px solid #101010; font-family: Helvetica,serif;}
th {border: 1px solid #101010; font-family: Helvetica,serif; color: #c3c0c3; font-weight: bold; text-align: center; padding: 10px;}
td {font-family: Helvetica,serif; color: #c3c3c3; text-align: center; padding: 2px;}
input {color: #c3c3c3; font-family: Helvetica,serif; background: #101010; border-top-width: 0; border-bottom-width: 1px; border-left-width: 0; border-right-width: 0; height: 20px; width: 200px;}
div.fade {animation: fadeInAnimation ease 0.3s; animation-iteration-count: 1;animation-fill-mode: forwards;}
ul.menu {list-style-type: none;margin:0;padding: 0;overflow: hidden;background-color: #333;}
li.menu {float: left;}
li.logout {float: right;}
li.menu a {display: block;color: white;text-align: center;padding: 14px 16px; text-decoration: none;}
li.menu a:hover {background-color: #111;}
li.logout a {display: block;color: #958a4b;text-align: center;padding: 14px 16px; text-decoration: none;}
li.logout a:hover {background-color: #111;}
14 changes: 14 additions & 0 deletions new_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding:utf-8 -*-
"""This only works on 1.2.0-stable or higher"""

import http.client

usr = ''
psw = ''
connection = http.client.HTTPConnection("0.0.0.0", 80)
connection.request("GET", f"/login?login={usr}:{psw}")
response = connection.getresponse()
print("Status: {} and reason: {}".format(response.status, response.reason))
print(response.read().decode())

connection.close()

0 comments on commit 2702036

Please sign in to comment.