mirror of
https://gitlab.com/octtspacc/OcttKB
synced 2025-06-06 00:29:12 +02:00
OcttKB Cross-Repo Sync (HTML to Raw)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
created: 20230307194210756
|
||||
created: 20230307221943341
|
||||
current-tiddler: GettingStarted
|
||||
modified: 20230307194210756
|
||||
modified: 20230307221943341
|
||||
title: $:/HistoryList
|
||||
type: application/json
|
@@ -8,12 +8,5 @@ tiddlywiki \
|
||||
--rendertiddler $:/core/templates/static.template.css Style.css text/plain \
|
||||
--rendertiddler $:/core/templates/alltiddlers.template.html Static.html text/plain
|
||||
|
||||
# Fix errors in the resulting HTML
|
||||
cat << EOF | python3
|
||||
from bs4 import BeautifulSoup;
|
||||
from re import sub;
|
||||
File = 'Static.html'
|
||||
def Fix1(m): return f'<details><a name="{m.group(1)}"></a><summary>{m.group(2)}</summary>';
|
||||
Source = str(BeautifulSoup(open(File, 'r'), 'html5lib'));
|
||||
open(File, 'w').write(sub('<details><a name="(.+)"><summary>(.+)<\/summary>\s*<\/a>', Fix1, Source));
|
||||
EOF
|
||||
# Apply patches to the static HTML
|
||||
python3 ../PatchStatic.py
|
||||
|
@@ -1,6 +1,6 @@
|
||||
created: 20230126082147025
|
||||
creator: Octt
|
||||
modified: 20230225230248038
|
||||
modified: 20230307221654772
|
||||
modifier: Octt
|
||||
title: $:/OcttKB/Repo/Build.sh
|
||||
type: text/plain
|
12
Wiki/tiddlers/System/$__OcttKB_Repo_PatchStatic.py.txt
Normal file
12
Wiki/tiddlers/System/$__OcttKB_Repo_PatchStatic.py.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
from bs4 import BeautifulSoup
|
||||
from re import sub
|
||||
|
||||
File = 'Static.html'
|
||||
|
||||
def Fix1(m):
|
||||
return f'<details><a name="{m.group(1)}"></a><summary>{m.group(2)}</summary>'
|
||||
|
||||
Source = str(BeautifulSoup(open(File, 'r'), 'html5lib'));
|
||||
|
||||
open(File, 'w').write(sub('<details><a name="(.+)"><summary>(.+)<\/summary>\s*<\/a>', Fix1, Source));
|
@@ -0,0 +1,6 @@
|
||||
created: 20230307221237990
|
||||
creator: Octt
|
||||
modified: 20230307221722752
|
||||
modifier: Octt
|
||||
title: $:/OcttKB/Repo/PatchStatic.py
|
||||
type: text/plain
|
@@ -1,6 +1,6 @@
|
||||
created: 20230307193342778
|
||||
created: 20230307212347887
|
||||
creator: Octt
|
||||
list:
|
||||
modified: 20230307194102788
|
||||
modified: 20230307221614637
|
||||
modifier: Octt
|
||||
title: $:/StoryList
|
@@ -1,6 +1,6 @@
|
||||
created: 20230108190740128
|
||||
creator: Octt
|
||||
modified: 20230307191744793
|
||||
modified: 20230307215827258
|
||||
modifier: Octt
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/Styles/Main
|
||||
@@ -99,6 +99,8 @@ Div.View-Breadcrumbs
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
.AiLink { opacity: 0.40; }
|
||||
|
||||
.DirList-Title, .DirList-Title * { Font-Style: Normal !Important; }
|
||||
.Separator-Right:last-of-type { Display: None; }
|
||||
|
||||
|
@@ -1,31 +1,29 @@
|
||||
created: 20230124112022156
|
||||
creator: Octt
|
||||
modified: 20230307194005027
|
||||
modified: 20230307214438744
|
||||
modifier: Octt
|
||||
tags:
|
||||
tags: $:/tags/ViewTemplate
|
||||
title: $:/Styles/View/9-99-Hacks
|
||||
|
||||
\define MainScript()
|
||||
\whitespace trim
|
||||
<<script script="
|
||||
var Title = `$(currentTiddler)$`.replaceAll();
|
||||
var Select = `.tc-tiddler-frame[data-tiddler-title='$(currentTiddler)$']`;
|
||||
Tiddlers = document.querySelectorAll(Select);
|
||||
alert(Tiddlers);
|
||||
|
||||
if (true) {
|
||||
var Query = decodeURIComponent('Please summarize the following article into concise key bullet points: ${URL}. Write the points as objective, generalized declarations that stand by themselves. Do not write them as to explain what the author thinks subjectively. Do not leave any point as unclear: each point must not lead the reader to asking any %22why%22; questions. Avoid boilerplate and repetitions.');
|
||||
var Title = `$(currentTiddler)$`.replaceAll(`'`, ''');
|
||||
var Select = `.tc-tiddler-frame[data-tiddler-title='${Title}']`;
|
||||
var Tiddlers = document.querySelectorAll(Select);
|
||||
Tiddlers.forEach(function(El){
|
||||
El.querySelectorAll('a.tc-tiddlylink-external').forEach(function(Link){
|
||||
var AiLink = document.createElement('span');
|
||||
AiLink.className = 'AiLink';
|
||||
AiLink.innerHTML = `<sup>[<a rel='noopener noreferrer' target='_blank' href='https://www.bing.com/search?q=${encodeURIComponent(Query.replace('${URL}', Link.href))}'>AI</a>]</sup>`;
|
||||
Link.after(AiLink);
|
||||
});
|
||||
});
|
||||
};
|
||||
">>
|
||||
\end
|
||||
|
||||
<!--
|
||||
<<script off>>
|
||||
<script>
|
||||
/*
|
||||
<$text text=<<currentTiddler>>/>
|
||||
*/
|
||||
/*
|
||||
document.querySelector('.tc-story-river > div[data-tiddler-title=""]')
|
||||
console.log();
|
||||
*/
|
||||
</script>
|
||||
<<script off>>
|
||||
-->
|
||||
<!--<<TiddlerViewShowBreadcrumbs>>-->
|
||||
<!-- <<MainScript>> -->
|
||||
<<MainScript>>
|
@@ -1,6 +1,6 @@
|
||||
created: 20220920174307633
|
||||
creator: Octt
|
||||
modified: 20230305220241073
|
||||
modified: 20230307214152122
|
||||
modifier: Octt
|
||||
title: $:/state/sidebar
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
created: 20220920092307479
|
||||
creator: Octt
|
||||
modified: 20230307194109370
|
||||
modified: 20230307221829948
|
||||
modifier: Octt
|
||||
title: $:/state/tab/sidebar--595412856
|
||||
|
||||
|
7
Wiki/tiddlers/System/$__state_tree_Saved_Posts_.tid
Normal file
7
Wiki/tiddlers/System/$__state_tree_Saved_Posts_.tid
Normal file
@@ -0,0 +1,7 @@
|
||||
created: 20230307215026101
|
||||
creator: Octt
|
||||
modified: 20230307215026780
|
||||
modifier: Octt
|
||||
title: $:/state/tree/Saved/Posts/
|
||||
|
||||
hide
|
Reference in New Issue
Block a user