Skip to content

Commit

Permalink
OcttKB Cross-Repo Sync (HTML to Raw)
Browse files Browse the repository at this point in the history
  • Loading branch information
octospacc committed Nov 5, 2023
1 parent 3d736a0 commit dfc37bc
Show file tree
Hide file tree
Showing 24 changed files with 133 additions and 39 deletions.
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/Normal/OcttKB/_WIP.tid
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
created: 20230126105640952
creator: Octt
modified: 20231105154317265
modified: 20231105214741288
modifier: Octt
tags: OcttKB WIP
title: OcttKB/WIP

!!! ''WIP/TODO''

//Note: this section is by itself in an heavy WIP state... I will never escape from this 😱️//
//Note: this section is by itself in an heavy WIP state..., and currently it's really outdated... I will never escape from this 😱️//

* Better footnotes (should be clickable)
* Fix StaticRiver template, broken after introducing breadcrumbs ~~(showing duplicate title, and also broken elements)~~
Expand Down
4 changes: 3 additions & 1 deletion Wiki-OcttKB/tiddlers/Normal/_C Language.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20231029134919585
creator: Octt
modified: 20231105110313014
modified: 20231105222349930
modifier: Octt
tags:
title: C Language
Expand All @@ -14,5 +14,7 @@ title: C Language

* [[strcpy vs. memcpy|https://stackoverflow.com/questions/2898364/strcpy-vs-memcpy]] --- //strcpy stops when it encounters a NUL ('\0') character, memcpy does not//, aka as the names suggest often strcpy is perfect for strings while for generic data memcpy could be needed.
* [[ISO C90 forbids mixed declarations and code in C|https://stackoverflow.com/questions/13291353/iso-c90-forbids-mixed-declarations-and-code-in-c]] --- old C standards required that new variables can be declared only before any other actual instruction in a scoped block, e.g. only at the top of a function

* [[Creating empty function macros|https://stackoverflow.com/questions/9187628/empty-function-macros]] --- only safe way is `#define SomeFunction(arg) ((void)0)`
** [[C macros, what's the meaning of ((void)0)?|https://stackoverflow.com/questions/61157541/c-macros-whats-the-meaning-of-void0]]
* [[How to use "else if" with the preprocessor #ifdef?|https://stackoverflow.com/questions/68696585/how-to-use-else-if-with-the-preprocessor-ifdef]] --- the only widely-supported way is: `#if defined(X)`...`#elif defined(Y)`...`#else`...`#endif`
5 changes: 4 additions & 1 deletion Wiki-OcttKB/tiddlers/Normal/_JavaScript.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20221110145611678
creator: Octt
modified: 20231103214720248
modified: 20231105221457293
modifier: Octt
tags: Development $:/i18n:en Web
title: JavaScript
Expand All @@ -22,6 +22,9 @@ title: JavaScript
* [[Does JavaScript have a method like "range()" to generate a range within the supplied bounds?|https://stackoverflow.com/questions/3895478/does-javascript-have-a-method-like-range-to-generate-a-range-within-the-supp]] --- `[...Array(5).keys()]`
* [[Array.prototype.splice()|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice]] --- //changes the contents of an array by removing or replacing existing elements and/or adding new elements in place//
* [[Listen for triple clicks in JavaScript|https://stackoverflow.com/questions/6480060/how-do-i-listen-for-triple-clicks-in-javascript#6480113]]
* [[XMLHttpRequest|https://www.w3schools.com/xml/xml_http.asp]]
** <<MDNLink Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests "Synchronous and asynchronous requests">>
* [[Fastest method to escape HTML tags as HTML entities?|https://stackoverflow.com/questions/5499078/fastest-method-to-escape-html-tags-as-html-entities]] --- in the browser, `(html) => { var escape = document.createElement('textarea'); escape.textContent = html; return escape.innerHTML; }`

!!! ''Tools''

Expand Down
4 changes: 3 additions & 1 deletion Wiki-OcttKB/tiddlers/Normal/_Keyboard.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
created: 20230725112836922
creator: Octt
modified: 20231105114026409
icon: ⌨️
modified: 20231105214847933
modifier: Octt
page-cover: https://source.unsplash.com/random?keyboard
tags:
title: Keyboard

Expand Down
5 changes: 3 additions & 2 deletions Wiki-OcttKB/tiddlers/Normal/_Language.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20230216193546517
creator: Octt
modified: 20230217094958892
modified: 20231105202624812
modifier: Octt
tags:
title: Language
Expand All @@ -20,4 +20,5 @@ title: Language
* [[Il gender e la traduzione di videogiochi — Outcast|https://www.outcast.it/home/il-gender-e-la-traduzione-di-videogiochi]] - <<mywarc 423>>

; Tools
: Machine translation: [ext[//DeepL.com]] | [ext[//Translate.Google.com]]
: Machine translation: <<httpsL DeepL.com>> | <<httpsL Translate.Google.com>>
:* <<linkdescgit "Lingva Translate" "https://lingva.ml" "Self-hostable alternative front-end and API for Google Translate" "https://github.com/TheDavidDelta/lingva-translate">> <<[# "Scraper Git" "https://github.com/thedaviddelta/lingva-scraper">>
14 changes: 7 additions & 7 deletions Wiki-OcttKB/tiddlers/Normal/_Octt.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ caption: Me
created: 20230206204149478
creator: Octt
icon: 😼
modified: 20230223220703013
modified: 20231105222046315
modifier: Octt
tags: $:/ToC
title: Octt

''Octt'', aka ''OctoSpacc'', or ''Andrea'', is me, the living entity who primarily maintains the [[OcttKB]]. I am powered by a natural neural network, in case that wasn't obvious.
''Octt'', aka ''OctoSpacc'', or ''Andrea'', is me, the living entity who primarily maintains the [[OcttKB]]. I am powered by a natural neural network running on a meat machine, in case that wasn't obvious, but I plan of making a copy (or multiple?) of myself that will live in silicon machines.

Some info about me should go here, I suppose, so here are some points:

* I can program enough things in [[vanilla JavaScript|JavaScript]], [[Python]], sh, some C and Java, and [[TiddlyWiki]] (wow). I will also say HTML and CSS just to make you cry with "they're not programming languages!!1!".
* I can program enough things in [[vanilla JavaScript|JavaScript]], [[Python]], `sh`, [[C|C Language]] and some [[Java]], and [[TiddlyWiki]] (wow). I will also say: I can program with HTML and CSS, just to make you cry with "they're not programming languages!!1!".
** I've had to use C++, well I hate it. Never had to use Rust, and I'm happy because that syntax //scares me//.
* I can solve some puzzle games (very little in the grand scheme of all puzzles of this world).
* My [[#ShowYourStripes|https://showyourstripes.info/l/europe/italy/all/]] --- aka the climate change situation also where I live.
* I can solve some puzzle games (very little in the grand scheme of all puzzles of this world, but still fun) and play some card games, they fun sometimes.
* Here is my [[#ShowYourStripes|https://showyourstripes.info/l/europe/italy/all/]] if you're curious --- aka the climate change situation also where I live.

After this, there's not a lot more info about me here for now. Tough luck. Maybe go read the about page on my [[sitoctt]] in the meantime: [[https://sitoctt.octt.eu.org/Chi-Sono.html]].
After this, there's not a lot more info about me here for now. Tough luck. Maybe go read the about page on my [[sitoctt]] in the meantime, there's something more in there: [[https://sitoctt.octt.eu.org/Chi-Sono.html]].

Here are some things I like or do or whatever, that I'm putting here honestly just to get some tiddlers connected together, because I like graphs like the ''Focus'' one on the sidebar.

* Graphs.. I just said I like them. Some others are at [[OcttKB/Data]].
* [[Gaming]], but I have special tastes probably.
** This not only includes videogames, but also puzzle games.
** [I should write my best picks here].
** [I should write my best picks here...]
* [[Writing]], like on my [[sitoctt]] or here.
* Software [[Development]], mostly frontend ([[CSS]] is crappy but epic).
** My [[Web]] places wouldn't be as unique if this wasn't the case and I were to only write content.
2 changes: 1 addition & 1 deletion Wiki-OcttKB/tiddlers/System/OcttKB/Config/_AiLinks.ui.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Enabled: 0
created: 20230413083119554
creator: Octt
modified: 20230429202841556
modified: 20231105185906145
modifier: Octt
tags: $:/GlobalOption
title: $:/OcttKB/Config/AiLinks.ui
Expand Down
6 changes: 3 additions & 3 deletions Wiki-OcttKB/tiddlers/System/Styles/View/_9-99-Hacks.tid
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
created: 20230124112022156
creator: Octt
modified: 20231103220122034
modified: 20231105185849353
modifier: Octt
tags: $:/tags/ViewTemplate
title: $:/Styles/View/9-99-Hacks

\define AiLinks(Enabled:1)
\define AiLinks()
\whitespace trim
<<script script="
try {
Expand All @@ -26,7 +26,7 @@ if ('$(Enabled)$' == 1) {
};

} catch(e) { ErrAtLine(e); };
">>
">><<script off>>
\end

<$set name=Enabled value={{$:/OcttKB/Config/AiLinks.ui!!Enabled}}>
Expand Down
65 changes: 65 additions & 0 deletions Wiki-OcttKB/tiddlers/System/Styles/View/_i18n.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
created: 20231105210128175
creator: Octt
list-after: $:/core/ui/ViewTemplate/tags
modified: 20231105232834847
modifier: Octt
tags: $:/tags/ViewTemplate
title: $:/Styles/View/i18n

\define OcttKB-i18n()
<<script script="try{
var BodySplitter = '</p>>';
var TidTitle = this.variables.thisTiddler.value;
var TidFrame = this.parentDomNode.parentElement;
/* var [TidTitleEl, TidBodyEl] = this.parentDomNode.parentElement.querySelectorAll('.tc-tiddler-title, .tc-tiddler-body'); */
var TidLangKnown = $tw.wiki.getTiddler(TidTitle).fields['i18n-main'];
this.parentDomNode.innerHTML += '[' + (TidLangKnown ? TidLangKnown : '?') + '] ';
var input = document.createElement('input');
input.type = 'text';
input.value = (window['OcttKB-i18n-current'] ? window['OcttKB-i18n-current'] : 'it');
input.onchange = function(){ window['OcttKB-i18n-current'] = input.value };
this.parentDomNode.appendChild(input);
var btn = document.createElement('button');
btn.innerHTML = 'Translate [Beta]';
btn.onclick = function(){
/* var TidLangGuessed; */
var TidBodyEl = TidFrame.querySelector('.tc-tiddler-body');
var TidBody = TidBodyEl.innerHTML;
var TidBodyParags = TidBody.trim().replaceAll('>', '>>').split(BodySplitter);
var TidBodyTranslated = '';
/* TODO: should probably fix the splitting to make it do longer segments, otherwise translations are more likely broken, and also find a good way to avoid the occasional translating of HTML elements; we should ideally do like the GTranslate embeddable script and parse the doctree to translate only the innerHTML strings */
for (var i=0; i<TidBodyParags.length; i++) {
if (TidBodyParags[i].trim()) {
/* TODO: make this not lock up the main thread */
var req = new XMLHttpRequest();
req.open('GET', `https://lingva.garudalinux.org/api/v1/${TidLangKnown ? TidLangKnown : 'auto'}/${window['OcttKB-i18n-current']}/${encodeURIComponent(TidBodyParags[i].trim())}`, false);
req.send();
var jsonResponse = JSON.parse(req.responseText);
TidBodyTranslated += jsonResponse.translation + BodySplitter;
/* TidLangGuessed = jsonResponse.info.detectedSource; */
}
}
var TransBodyEl = document.createElement('div');
TransBodyEl.innerHTML += TidBodyTranslated.replaceAll('>>', '>');
TidFrame.appendChild(TransBodyEl);
TidBodyEl.style.display = 'none';
btn.style.display = 'none';

var close = document.createElement('button');
close.innerHTML = '❌ Close';
close.onclick = function(){
TidFrame.removeChild(TransBodyEl);
TidBodyEl.style.display = 'revert';
btn.style.display = 'revert';
this.parentElement.removeChild(close);
};
this.parentElement.appendChild(close);
};
this.parentDomNode.appendChild(btn);
} catch(e) { ErrAtLine(e); };
">><<script off>>
\end

<div class="OcttKB-i18n">
<<OcttKB-i18n>>
</div>
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/_HistoryList.json.meta
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20231105154350579
created: 20231105232914777
current-tiddler: GettingStarted
modified: 20231105154350579
modified: 20231105232914777
title: $:/HistoryList
type: application/json
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/_StoryList.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20231105114939903
created: 20231105231431599
creator: Octt
list:
modified: 20231105154203230
modified: 20231105232654357
modifier: Octt
title: $:/StoryList
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/_showeditpreview.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20220920140732083
creator: Octt
modified: 20231105151132314
modified: 20231105210451811
modifier: Octt
title: $:/state/showeditpreview

yes
no
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/_tab--1498284803.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20230109143853256
creator: Octt
modified: 20231105151648391
modified: 20231104195014618
modifier: Octt
title: $:/state/tab--1498284803

$:/core/ui/AdvancedSearch/System
$:/core/ui/AdvancedSearch/Standard
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20230109143853256
creator: Octt
modified: 20231105151648391
modified: 20231104195014617
modifier: Octt
title: $:/state/advancedsearch/currentTab

$:/core/ui/AdvancedSearch/System
$:/core/ui/AdvancedSearch/Standard
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20231105231235764
creator: Octt
modified: 20231105232534359
modifier: Octt
title: $:/state/folded/$:/Styles/View/i18n

hide
7 changes: 7 additions & 0 deletions Wiki-OcttKB/tiddlers/System/state/folded/_Language.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20231105202356015
creator: Octt
modified: 20231105202357290
modifier: Octt
title: $:/state/folded/Language

show
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20220920092307479
creator: Octt
modified: 20231105154128796
modified: 20231105232842380
modifier: Octt
title: $:/state/tab/sidebar--595412856

Expand Down
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/tree/$/Macros/_.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20221108155618185
creator: Octt
modified: 20231105151711128
modified: 20231105183045128
modifier: Octt
title: $:/state/tree/$:/Macros/

show
hide
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/tree/$/OcttKB/Config/_.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20230225225512618
creator: Octt
modified: 20231105104713926
modified: 20231105214436728
modifier: Octt
title: $:/state/tree/$:/OcttKB/Config/

show
hide
7 changes: 7 additions & 0 deletions Wiki-OcttKB/tiddlers/System/state/tree/$/OcttKB/Utils/_.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
created: 20231105214440145
creator: Octt
modified: 20231105214441095
modifier: Octt
title: $:/state/tree/$:/OcttKB/Utils/

hide
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/tree/$/OcttKB/_.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20230111084703963
creator: Octt
modified: 20231105151708695
modified: 20231105185204090
modifier: Octt
title: $:/state/tree/$:/OcttKB/

hide
show
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/tree/$/Styles/_.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20230108193801573
creator: Octt
modified: 20231105151710124
modified: 20231105214443871
modifier: Octt
title: $:/state/tree/$:/Styles/

hide
show
2 changes: 1 addition & 1 deletion Wiki-OcttKB/tiddlers/System/state/tree/$/core/_.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20221109224641397
creator: Octt
modified: 20230219190410251
modified: 20231105184234925
modifier: Octt
title: $:/state/tree/$:/core/

Expand Down
2 changes: 1 addition & 1 deletion Wiki-OcttKB/tiddlers/System/state/tree/$/state/_.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20221107223237374
creator: Octt
modified: 20231104225246445
modified: 20231105181810264
modifier: Octt
title: $:/state/tree/$:/state/

Expand Down

0 comments on commit dfc37bc

Please sign in to comment.