Skip to content

Commit 39735ab

Browse files
author
luginf
committed
Revert "remove other commits outside the scope of this branch"
This reverts commit a72474a.
1 parent a72474a commit 39735ab

13 files changed

Lines changed: 12386 additions & 468 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: "🧪 Run tests"
1+
name: Run tests
22

33
on:
44
push:
5+
branches: [main]
56
pull_request:
7+
branches: [main]
68

79
jobs:
810
build:
911
runs-on: ubuntu-latest
1012
steps:
1113
- uses: actions/checkout@v2
12-
- name: "Run tests"
14+
- name: Run tests
1315
run: php ./.github/workflows/scripts/run-tests.php

.github/workflows/scripts/run-tests.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
$errors = $testHelper->errors;
1212
if (count($errors) > 0) {
13-
foreach ($errors as $dir => $scriptErrors) {
13+
foreach($errors as $dir => $scriptErrors) {
1414
print "Directory '$dir'\n";
1515

16-
foreach ($scriptErrors as $error) {
16+
foreach($scriptErrors as $error) {
1717
print " $error\n";
1818
}
1919
}
@@ -24,15 +24,13 @@
2424
print "No errors were found\n";
2525
exit(0);
2626

27-
class TestHelper
28-
{
27+
class TestHelper {
2928
public $errors = [];
3029

3130
/**
3231
* Tests the files in a directory
3332
*/
34-
public function testDirectory($dir)
35-
{
33+
public function testDirectory($dir) {
3634
$errors = [];
3735

3836
if (preg_match('/[^a-z0-9\-]/', $dir)) {
@@ -89,7 +87,7 @@ public function testDirectory($dir)
8987
$errors[] = "'platforms' has to be an array!";
9088
} else {
9189
foreach ($data["platforms"] as $platform) {
92-
if (!in_array($platform, ["linux", "macos", "windows"])) {
90+
if (!in_array($platform, array("linux", "macos", "windows"))) {
9391
$errors[] = "Unsupported platform '$platform', only 'linux', 'macos' and 'windows' are allowed!";
9492
}
9593
}

ai-github-copilot-backend/ai-github-copilot-backend.qml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ import QOwnNotesTypes 1.0
1515
*
1616
*/
1717
Script {
18-
property string githubToken
18+
property string githubToken;
1919

2020
property variant settingsVariables: [
2121
{
2222
"identifier": "githubToken",
2323
"name": "GitHub Personal Access Token",
2424
"description": "Enter your GitHub PAT (create at https://github.com/settings/tokens).\nFine-grained: enable 'Models: Read' permission.\nClassic: the 'models' scope is needed.",
2525
"type": "string-secret",
26-
"default": ""
26+
"default": "",
2727
}
28-
]
28+
];
2929

3030
function openAiBackendsHook() {
3131
if (!githubToken || githubToken === "") {
@@ -38,7 +38,32 @@ Script {
3838
"name": "GitHub",
3939
"baseUrl": "https://models.inference.ai.azure.com/chat/completions",
4040
"apiKey": githubToken,
41-
"models": ["gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-5", "gpt-5-mini", "gpt-5-nano", "o4-mini", "o3", "o3-mini", "o1", "o1-mini", "deepseek-r1", "deepseek-r1-0528", "deepseek-v3-0324", "llama-4-scout-17b-16e-instruct", "llama-4-maverick-17b-128e-instruct-fp8", "llama-3.3-70b-instruct", "grok-3", "grok-3-mini", "mistral-small-2503", "phi-4", "phi-4-reasoning",]
41+
"models": [
42+
"gpt-4o",
43+
"gpt-4o-mini",
44+
"gpt-4.1",
45+
"gpt-4.1-mini",
46+
"gpt-4.1-nano",
47+
"gpt-5",
48+
"gpt-5-mini",
49+
"gpt-5-nano",
50+
"o4-mini",
51+
"o3",
52+
"o3-mini",
53+
"o1",
54+
"o1-mini",
55+
"deepseek-r1",
56+
"deepseek-r1-0528",
57+
"deepseek-v3-0324",
58+
"llama-4-scout-17b-16e-instruct",
59+
"llama-4-maverick-17b-128e-instruct-fp8",
60+
"llama-3.3-70b-instruct",
61+
"grok-3",
62+
"grok-3-mini",
63+
"mistral-small-2503",
64+
"phi-4",
65+
"phi-4-reasoning",
66+
],
4267
}
4368
];
4469
}

devenv.nix

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@
66
{
77
# https://devenv.sh/git-hooks/
88
git-hooks.hooks = {
9-
php-cs-fixer = {
10-
enable = true;
11-
entry = pkgs.lib.mkForce "${pkgs.phpPackages."php-cs-fixer"}/bin/php-cs-fixer fix";
12-
args = [
13-
"--config"
14-
"./.php-cs-fixer.dist.php"
15-
];
16-
language = "system";
17-
pass_filenames = true;
18-
require_serial = true;
19-
stages = [ "pre-commit" ];
20-
types = [ "php" ];
21-
};
22-
239
# Custom pre-commit hook to format justfile
2410
qmlformat = {
2511
enable = true;

insert-moc/insert-moc.qml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ Script {
2727
var relDir = noteObj.relativeNoteFileDirPath;
2828

2929
// Construct filePath and encoded path
30-
var filePath = relDir && relDir.length > 0 ? relDir + "/" + name + "." + ext : name + "." + ext;
31-
var rawLink = (relDir && relDir.length > 0 ? relDir + "/" + name : name);
32-
var encoded = encodeURIComponent(rawLink).replace(/%2F/g, "/").replace(/%2E/g, ".") + "." + ext;
30+
var filePath = relDir && relDir.length > 0
31+
? relDir + "/" + name + "." + ext
32+
: name + "." + ext;
33+
var rawLink = (relDir && relDir.length > 0
34+
? relDir + "/" + name
35+
: name);
36+
var encoded = encodeURIComponent(rawLink)
37+
.replace(/%2F/g, "/")
38+
.replace(/%2E/g, ".") + "." + ext;
3339

3440
// Format line
3541
var line = "|" + filePath + " | ---> [" + name + "." + ext + "](" + encoded + ")| ";
Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
{
2-
"name": "Link Importer and converter for Obsidian/Github/Pandoc/Markor and others",
3-
"identifier": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others",
4-
"script": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others.qml",
5-
"authors": ["@netlimpopo", "@gzgandalf"],
6-
"platforms": ["linux", "macos", "windows"],
7-
"version": "0.0.1",
8-
"minAppVersion": "26.1.5",
9-
"description": "<h2> Intro</h2><p>This script imports and exports links from other editors such as <strong>Obsidian/VS Code/Github/Markor/Pandoc</strong> into QOwnNotes and vice versa. It allows for quick switching between markdown editors. In Obsidian please use the plugin <a href='https://github.com/mnaoumov/obsidian-better-markdown-links'>Better markdown links</a> to first convert to standard markdown links instead of Wikilinks. Unfortunately markdown as a language is not as well defined as <i>orgmode</i> for instance. Especially heading Fragments and URL encoding of links differ quite significantly ([note](note.md#heading-fragment) vs. [note](note.md#Heading%20Fragment)). In practice, <strong>links to headings will break</strong> if one does not adapt the links to the specific needs of the editor. They might be readable by the editor, but renaming of notes / headings might break links silently, without you noticing.</p><h2>Usage</h2><p> Caution! Backup your data before you use this script as it might break all you links!</p><p>Simply copy files or folders into the QN Foldersystem. Then <strong>press the import/export button</strong> in the script menu, depending on which style you prefer. Done. For further info see <a href='https://github.com/pbek/QOwnNotes/issues/3225'>Ways to improve compatibility with other markdown editors</a>.</p>"
10-
}
1+
{
2+
"name": "Link Importer and converter for Obsidian/Github/Pandoc/Markor and others",
3+
"identifier": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others",
4+
"script": "link-importer-and-converter-for-obsidian-github-pandoc-markor-and-others.qml",
5+
"authors": [
6+
"@netlimpopo",
7+
"@gzgandalf"
8+
],
9+
"platforms": [
10+
"linux",
11+
"macos",
12+
"windows"
13+
],
14+
"version": "0.0.1",
15+
"minAppVersion": "26.1.5",
16+
"description": "<h2> Intro</h2><p>This script imports and exports links from other editors such as <strong>Obsidian/VS Code/Github/Markor/Pandoc</strong> into QOwnNotes and vice versa. It allows for quick switching between markdown editors. In Obsidian please use the plugin <a href='https://github.com/mnaoumov/obsidian-better-markdown-links'>Better markdown links</a> to first convert to standard markdown links instead of Wikilinks. Unfortunately markdown as a language is not as well defined as <i>orgmode</i> for instance. Especially heading Fragments and URL encoding of links differ quite significantly ([note](note.md#heading-fragment) vs. [note](note.md#Heading%20Fragment)). In practice, <strong>links to headings will break</strong> if one does not adapt the links to the specific needs of the editor. They might be readable by the editor, but renaming of notes / headings might break links silently, without you noticing.</p><h2>Usage</h2><p> Caution! Backup your data before you use this script as it might break all you links!</p><p>Simply copy files or folders into the QN Foldersystem. Then <strong>press the import/export button</strong> in the script menu, depending on which style you prefer. Done. For further info see <a href='https://github.com/pbek/QOwnNotes/issues/3225'>Ways to improve compatibility with other markdown editors</a>.</p>"
17+
18+
}
19+

0 commit comments

Comments
 (0)