Compare commits
5 Commits
c99006eb19
...
82aa717d49
Author | SHA1 | Date |
---|---|---|
|
82aa717d49 | |
|
efa550f7ec | |
|
866cbfa70b | |
|
dbef0937b3 | |
|
ef5c8e32f3 |
|
@ -42,7 +42,7 @@ div.position-fixed {
|
|||
right: 20px;
|
||||
z-index: 1000;
|
||||
width:17.5%;
|
||||
height:80%;
|
||||
height:90%;
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ div.position-fixed {
|
|||
}
|
||||
|
||||
li.a.nav-link {
|
||||
display: block;
|
||||
display: table;
|
||||
margin: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
352
lua_api.html
352
lua_api.html
File diff suppressed because one or more lines are too long
18
parserv6.py
18
parserv6.py
|
@ -3,7 +3,17 @@ print("**Minetest lua_api.txt Markdown parser - mt-lua-api-pyparse - converts Ma
|
|||
print("**Written by Lars Müller alias LMD in Python 3.5 - requires Python >= 3.2**")
|
||||
print("**Furthermore, this script has to be in the same folder as generate_bg.py, template.html, jumbotron.css, and the images taken from Minetest Game.**")
|
||||
print("**The images taken from Minetest Game are licensed under CC-BY-SA 3.0, credits go to the Minetest Artists.**")
|
||||
from cgi import html
|
||||
#from cgi import html
|
||||
from xml.sax.saxutils import escape, unescape
|
||||
|
||||
html_escape_table = {
|
||||
'"': """,
|
||||
"'": "'"
|
||||
}
|
||||
|
||||
def html_escape(text):
|
||||
return escape(text, html_escape_table)
|
||||
|
||||
import urllib.request as url
|
||||
import urllib.parse as parse
|
||||
print("**Generating underground Minetest scene...**")
|
||||
|
@ -56,6 +66,8 @@ def parse_markdown(string,parent=False): # PARSES A SINGLE LINE !
|
|||
if (string[0]=="#"):
|
||||
space=string.find(" ")
|
||||
c=string[0:space-1].count("#")
|
||||
if space==-1 or string[space+1:].count(" ")==len(string)-space-1:
|
||||
return "<br>"
|
||||
if (space-1==c):
|
||||
ID+=1
|
||||
c+=1
|
||||
|
@ -150,7 +162,7 @@ def parse_markdown(string,parent=False): # PARSES A SINGLE LINE !
|
|||
p,s='<a href="'+tag[2]+'">',"</a>"
|
||||
elif tag[1]=="italic":
|
||||
p,s="<em>","</em>"
|
||||
result+=p+html.escape(string)+s
|
||||
result+=p+html_escape(string)+s
|
||||
return prefix+"<p>"+result+"</p>"
|
||||
|
||||
def parse_md(string): # Parse line by line
|
||||
|
@ -187,7 +199,7 @@ def parse_md(string): # Parse line by line
|
|||
|
||||
lval=""
|
||||
if ident:
|
||||
lval=html.escape(line[4:])+"\n"
|
||||
lval=html_escape(line[4:])+"\n"
|
||||
else:
|
||||
lval=parse_markdown(line)
|
||||
ret+=prefix+lval
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<!doctype html>
|
||||
<!-- Template for lua_api.html -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<body data-spy="scroll" data-target="#contenttable" data-offset="15" style="background: url('background.png') no-repeat center center fixed;background-size: 100% 100%;background-repeat: no-repeat;image-rendering:optimizeSpeed">
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Minetest Magic-CTF homepage">
|
||||
<meta name="author" content="Lars Müller">
|
||||
<meta name="description" content="Minetest Lua API">
|
||||
<meta name="author" content="Minetest Core Developers">
|
||||
<link rel="icon" href="icon.png">
|
||||
<div class="bg"></div>
|
||||
|
||||
|
@ -16,42 +18,48 @@
|
|||
<!-- Bootstrap core CSS -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<link href="jumbotron.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
|
||||
|
||||
<body data-spy="scroll" data-target="#contenttable" data-offset="15">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Table of content -->
|
||||
<div class="position-fixed">
|
||||
<div class="position-fixed" id="toc">
|
||||
<nav class="col-lg" id="contenttable">
|
||||
<ul class="nav nav-pills nav-stacked affix" data-spy="affix" data-offset-top="205">
|
||||
<ul class="nav flex-column nav-pills affix" id="v-pills-tab" data-spy="affix" data-offset-top="205">
|
||||
<!--PLACENAV-->
|
||||
<!--Python script places stuff here-->
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="jumbotron" style="background: url('background.png') no-repeat center center fixed;background-size: 100% 100%;background-repeat: no-repeat;image-rendering:optimizeSpeed">
|
||||
<!--<div class="jumbotron" style="background-color:rgba(0,0,0,0)">-->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg">
|
||||
<div class="row" style="width:85%;">
|
||||
<div class="col-lg" style="display:inline-block;height:100%;">
|
||||
<div>
|
||||
<!--PLACESTUFF-->
|
||||
</div>
|
||||
<!--Python script places stuff here-->
|
||||
<hr>
|
||||
<p>Minetest is a free software game engine currently under development to create various games based on voxel gameplay, inspired by InfiniMiner, Minecraft, and the like. Minetest was originally created by Perttu Ahola (alias “celeron55”). </p>
|
||||
<a>Generated out of <a href="https://github.com/minetest/minetest/blob/master/doc/lua_api.txt">lua_api.txt</a> by </a><a href="https://github.com/appgurueu/mt-lua-api-pyparse">mt-lua-api-pyparse</a><a>.</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
<!--</div>-->
|
||||
|
||||
|
||||
<div class="container">
|
||||
<footer>
|
||||
<p>Minetest is a free software game engine currently under development to create various games based on voxel gameplay, inspired by InfiniMiner, Minecraft, and the like. Minetest was originally created by Perttu Ahola (alias “celeron55”). </p>
|
||||
<p>© Minetest Lua API Python Parser(mt-lua-api-pyparse) - Lars Müller</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script>
|
||||
var last=""
|
||||
var objDiv=document.getElementById("toc")
|
||||
function scroll() {
|
||||
var elem=document.getElementsByClassName("nav-link active")[0]
|
||||
if (elem != null && last != elem.textContent) {
|
||||
last=elem.textContent;
|
||||
objDiv.scrollTop = elem.offsetTop;
|
||||
}
|
||||
}
|
||||
window.setInterval(scroll,5)
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
Loading…
Reference in New Issue