database params in CONFIG + clean
This commit is contained in:
parent
aa64c9a6d7
commit
723feddac5
@ -1,13 +1,14 @@
|
||||
from config import CONFIG
|
||||
from peewee import *
|
||||
|
||||
db = MySQLDatabase(
|
||||
"spip",
|
||||
CONFIG["db"],
|
||||
**{
|
||||
"charset": "utf8",
|
||||
"sql_mode": "PIPES_AS_CONCAT",
|
||||
"use_unicode": True,
|
||||
"user": "spip",
|
||||
"password": "password",
|
||||
"user": CONFIG["dbUser"],
|
||||
"password": CONFIG["dbPass"],
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -1 +1,7 @@
|
||||
CONFIG = {"outputDir": "output", "maxExportNb": 1000}
|
||||
CONFIG = {
|
||||
"db": "spip",
|
||||
"dbUser": "spip",
|
||||
"dbPass": "password",
|
||||
"outputDir": "output",
|
||||
"maxExportNb": 1000,
|
||||
}
|
||||
|
@ -1,47 +1,9 @@
|
||||
import re
|
||||
|
||||
|
||||
def italic(text):
|
||||
# convert SPIP italic to markdown italic
|
||||
# return re.sub(r"([^\{]*)([^\{\}]*)([^\{]*)", r"\1\*\2\*\3", text)
|
||||
pass
|
||||
|
||||
|
||||
def bold(text):
|
||||
# convert SPIP bold to markdown bold
|
||||
pass
|
||||
|
||||
|
||||
def headings(text):
|
||||
# convert SPIP headings to markdown headings
|
||||
pass
|
||||
|
||||
|
||||
def code_blocks(text):
|
||||
# convert SPIP code blocks to markdown code blocks
|
||||
pass
|
||||
|
||||
|
||||
def links(text):
|
||||
# convert SPIP links to markdown links
|
||||
pass
|
||||
|
||||
|
||||
def paragraphs(text):
|
||||
# convert SPIP paragraphs to markdown paragraphs
|
||||
pass
|
||||
|
||||
|
||||
class content:
|
||||
def __init__(self, content):
|
||||
self.spip = content
|
||||
|
||||
def get_markdown(self):
|
||||
markdown = self.spip
|
||||
markdown = paragraphs(markdown)
|
||||
markdown = italic(markdown)
|
||||
markdown = bold(markdown)
|
||||
markdown = headings(markdown)
|
||||
markdown = links(markdown)
|
||||
markdown = code_blocks(markdown)
|
||||
return markdown
|
||||
|
@ -4,7 +4,6 @@ import shutil
|
||||
import sys
|
||||
|
||||
# from datetime import date, datetime, time
|
||||
# Modules
|
||||
from config import CONFIG
|
||||
from content import content
|
||||
from metadata import metadata
|
||||
|
Loading…
Reference in New Issue
Block a user