Skip to content

Commit

Permalink
docs exampwes fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AyhamAl-Ali committed Apr 1, 2024
1 parent 7060df4 commit 5555f88
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/main/java/ch/njol/skript/doc/HTMLGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,22 +373,6 @@ else if (!filesInside.getName().matches("(?i)(.*)\\.(html?|js|css|json)")) {

page = page.replace(page.substring(generate, nextBracket + 1), generated.toString());

// skwipt
String ogTitle = "Skript Documentation";
String ogDesc = "Skript is a Bukkit plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.";
String homepageDesc = "is (surprise, surprise) a scripting plugin for the Bukkit platform. It is easy to use for simple tasks, but you can also create really complex things with it. The syntax of Skript is close to English, but it is still not magic. While you might succeed with experimentation for simple tasks, for anything more complex you will need some guidance.";
String homepageDesc2 = "This is Skript's documentation. You will find all supported features of the plugin here, along with some useful examples. We don't have tutorials yet, but you can find good ones using whatever search engine you prefer.";
Pattern exampleCode = Pattern.compile("command /sethome:.*?You have been teleported.");
Pattern skriptPattern = Pattern.compile("(?<=[a-zA-Z0-9]|^|>)([Ss]kript)");
page = page.replace(ogTitle, introduceSkwipt(ogTitle));
page = page.replace(ogDesc, introduceSkwipt(ogDesc));
page = page.replace(homepageDesc, introduceSkwipt(homepageDesc));
page = page.replace(homepageDesc2, introduceSkwipt(homepageDesc2));
Matcher exampleMatcher = exampleCode.matcher(page);
Matcher skriptMatcher = skriptPattern.matcher(page);
page = exampleMatcher.replaceAll(introduceSkwipt(exampleMatcher.group(0)));
page = skriptMatcher.replaceAll(introduceSkwipt(skriptMatcher.group(1)));

generate = page.indexOf("${generate", nextBracket);
}

Expand All @@ -398,6 +382,23 @@ else if (!filesInside.getName().matches("(?i)(.*)\\.(html?|js|css|json)")) {
assert page != null;
page = minifyHtml(page);
}

// skwipt
String ogTitle = "Skript Documentation";
String ogDesc = "Skript is a Bukkit plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.";
String homepageDesc = "is (surprise, surprise) a scripting plugin for the Bukkit platform. It is easy to use for simple tasks, but you can also create really complex things with it. The syntax of Skript is close to English, but it is still not magic. While you might succeed with experimentation for simple tasks, for anything more complex you will need some guidance.";
String homepageDesc2 = "This is Skript's documentation. You will find all supported features of the plugin here, along with some useful examples. We don't have tutorials yet, but you can find good ones using whatever search engine you prefer.";
Pattern exampleCode = Pattern.compile("command /sethome:.*?You have been teleported.");
Pattern skriptPattern = Pattern.compile("(?<=[a-zA-Z0-9]|^|>)([Ss]kript)");
page = page.replace(ogTitle, introduceSkwipt(ogTitle));
page = page.replace(ogDesc, introduceSkwipt(ogDesc));
page = page.replace(homepageDesc, introduceSkwipt(homepageDesc));
page = page.replace(homepageDesc2, introduceSkwipt(homepageDesc2));
Matcher exampleMatcher = exampleCode.matcher(page);
page = exampleMatcher.replaceAll(introduceSkwipt(exampleMatcher.group(0)));
Matcher skriptMatcher = skriptPattern.matcher(page);
page = skriptMatcher.replaceAll(introduceSkwipt(skriptMatcher.group(1)));

assert page != null;
writeFile(new File(output + File.separator + name), page);
}
Expand Down

0 comments on commit 5555f88

Please sign in to comment.