Skip to content

Commit bb18b02

Browse files
author
Simon Schubert
committed
Add commands
1 parent d3f0301 commit bb18b02

File tree

9 files changed

+227
-35
lines changed

9 files changed

+227
-35
lines changed

android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ android {
3939
applicationId = "com.inspiredandroid.linuxcommandbibliotheca"
4040
minSdk = 24
4141
targetSdk = 35
42-
versionCode = 99
42+
versionCode = 100
4343
versionName = project.version.toString()
4444
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4545
}

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/PreferenceUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ class PreferenceUtil(context: Context) {
4545
companion object {
4646
const val KEY_BOOKMARKS = "KEY_BOOKMARKS"
4747
const val KEY_DATABASE_VERSION = "DATABASE_VERSION"
48-
const val CURRENT_DATABASE_VERSION = 14
48+
const val CURRENT_DATABASE_VERSION = 15
4949
}
5050
}

assets/database.db

160 KB
Binary file not shown.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ buildscript {
2020
}
2121

2222
group = "com.inspiredandroid"
23-
version = "3.3.5"
23+
version = "3.3.6"
2424

2525
allprojects {
2626
repositories {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=3.3.5
1+
version=3.3.6

desktop/src/main/kotlin/com/linuxcommandlibrary/desktop/WebsiteBuilder.kt

Lines changed: 217 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ fun main() {
9595
websiteBuilder.createManHtmlFiles(File(folder, "man"))
9696

9797
websiteBuilder.create404HtmlFile()
98+
websiteBuilder.createPrivacyPolicyHtmlFile(folder)
99+
websiteBuilder.createContactHtmlFile(folder)
100+
websiteBuilder.createTermsAndConditionsHtmlFile(folder)
98101

99102
websiteBuilder.createSitemap(folder)
100103

@@ -538,7 +541,7 @@ class WebsiteBuilder {
538541
stream.close()
539542
}
540543

541-
internal fun createManHtmlFiles(folder: File) {
544+
fun createManHtmlFiles(folder: File) {
542545
folder.mkdir()
543546

544547
val commands = databaseHelper.getCommands()
@@ -685,7 +688,187 @@ class WebsiteBuilder {
685688
println()
686689
}
687690

688-
fun sanitizeHtml(content: String): String = content.replace(Regex("(?i)<(html|head|title|body)[^>]*>.*?</\\1>|<(html|head|title|body)[^>]*>"), "")
691+
fun createTermsAndConditionsHtmlFile(folder: File) {
692+
println("Create terms and conditions html")
693+
694+
folder.mkdir()
695+
696+
val file = File(folder, "terms-conditions.html")
697+
file.delete()
698+
val stream = PrintStream(file)
699+
700+
stream.appendLine("<!DOCTYPE html>")
701+
702+
stream.appendHTML().html {
703+
lang = "en"
704+
head {
705+
commonMeta(adSense = false)
706+
val title = "Terms and Conditions | Linux Command Library"
707+
uncommonMeta(
708+
title = title,
709+
description = "",
710+
url = "https://linuxcommandlibrary.com/${file.nameWithoutExtension}",
711+
keywords = "",
712+
)
713+
714+
styleLink("/stylesheets/main.css?v=$cacheVersion")
715+
}
716+
717+
body {
718+
header(-1)
719+
720+
div {
721+
id = "content"
722+
723+
h1 { +"Terms and Conditions" }
724+
725+
h2 { +"Educational Purpose Only" }
726+
p {
727+
+"The content on Linux Command Library is provided solely for educational and informational purposes. It is intended to assist users in learning about Linux commands."
728+
}
729+
730+
h2 { +"Disclaimer of Liability" }
731+
p {
732+
+"The commands on this website can be powerful and may cause data loss or system damage if misused. Users are responsible for verifying and safely using the commands. Linux Command Library is not liable for any damage or loss resulting from the use or misuse of this information."
733+
}
734+
735+
h2 { +"Copyright and Credits" }
736+
p {
737+
+"Man pages referenced on this site are copyrighted by their respective authors and used under fair use principles for educational reference. We gratefully acknowledge inspiration and contributions from "
738+
a(href = "https://tldr.sh/") { +"TLDR" }
739+
+" and "
740+
a(href = "https://www.commandlinefu.com/") { +"commandlinefu.com" }
741+
+"."
742+
}
743+
}
744+
745+
footer(showAd = false)
746+
}
747+
}
748+
stream.close()
749+
}
750+
751+
fun createPrivacyPolicyHtmlFile(folder: File) {
752+
println("Create privacy html")
753+
754+
folder.mkdir()
755+
756+
val file = File(folder, "privacy-policy.html")
757+
file.delete()
758+
val stream = PrintStream(file)
759+
760+
stream.appendLine("<!DOCTYPE html>")
761+
762+
stream.appendHTML().html {
763+
lang = "en"
764+
head {
765+
commonMeta(adSense = false)
766+
val title = "Privacy Policy | Linux Command Library"
767+
uncommonMeta(
768+
title = title,
769+
description = "",
770+
url = "https://linuxcommandlibrary.com/${file.nameWithoutExtension}",
771+
keywords = "",
772+
)
773+
774+
styleLink("/stylesheets/main.css?v=$cacheVersion")
775+
}
776+
777+
body {
778+
header(-1)
779+
780+
div {
781+
id = "content"
782+
783+
h1 { +"Privacy Policy" }
784+
p { +"Last Updated: April 19, 2025" }
785+
786+
h2 { +"1. No Data Collection or Tracking" }
787+
p { +"Our website does not use cookies, web beacons, or any other tracking technologies to collect personal information about your browsing activities." }
788+
p { +"We do not collect any personal data from users. There are no contact forms, email sign-ups, or other mechanisms that gather personal information on our website." }
789+
790+
h2 { +"2. Future Use of Cookies (Google AdSense)" }
791+
p {
792+
+"If our website is approved for Google AdSense, we may use cookies to serve personalized advertisements. These cookies would be managed by Google and are subject to "
793+
a(href = "https://policies.google.com/privacy") { +"Google’s Privacy Policy" }
794+
+". If this occurs, we will update this Privacy Policy to reflect the change and provide details on how cookies are used for advertising purposes."
795+
}
796+
p { +"You will be able to manage your ad preferences through Google’s Ad Settings." }
797+
798+
h2 { +"3. Your Rights (GDPR Compliance)" }
799+
p { +"For EU Users: If you are located in the European Union, you have the right to access, correct, or delete any personal data we may hold about you. Since we do not collect personal data through tracking or forms, no such data is stored." }
800+
p { +"Cookie Consent (Future): If we introduce cookies for advertising in the future, we will implement a cookie consent mechanism for EU users to ensure compliance with GDPR." }
801+
802+
h2 { +"4. Contact Us" }
803+
p { +"If you have any questions or concerns about this Privacy Policy, you can contact us at [your email address]." }
804+
805+
h2 { +"5. Changes to This Policy" }
806+
p { +"We may update this Privacy Policy from time to time, especially if we introduce new features or services that affect data handling (e.g., Google AdSense). Any changes will be posted on this page with an updated 'Last Updated' date." }
807+
}
808+
809+
footer(showAd = false)
810+
}
811+
}
812+
stream.close()
813+
}
814+
815+
fun createContactHtmlFile(folder: File) {
816+
println("Create contact html")
817+
818+
folder.mkdir()
819+
820+
val file = File(folder, "contact.html")
821+
file.delete()
822+
val stream = PrintStream(file)
823+
824+
stream.appendLine("<!DOCTYPE html>")
825+
826+
stream.appendHTML().html {
827+
lang = "en"
828+
head {
829+
commonMeta(adSense = false)
830+
val title = "Contact | Linux Command Library"
831+
uncommonMeta(
832+
title = title,
833+
description = "",
834+
url = "https://linuxcommandlibrary.com/${file.nameWithoutExtension}",
835+
keywords = "",
836+
)
837+
838+
styleLink("/stylesheets/main.css?v=$cacheVersion")
839+
}
840+
841+
body {
842+
header(-1)
843+
844+
div {
845+
id = "content"
846+
847+
h1 { +"Contact Us" }
848+
p {
849+
+"Have questions, feedback, or issues about Linux Command Library?"
850+
}
851+
p {
852+
+"Please reach out to us at "
853+
a(href = "mailto:info@linuxcommandlibrary.com") { +"info@linuxcommandlibrary.com" }
854+
+". We aim to respond within 2-3 business days."
855+
}
856+
p {
857+
+"For more information about our site, please review our "
858+
a(href = "/privacy-policy") { +"Privacy Policy" }
859+
+" and "
860+
a(href = "/terms-and-conditions") { +"Terms and Conditions" }
861+
+"."
862+
}
863+
}
864+
865+
footer(showAd = false)
866+
}
867+
}
868+
stream.close()
869+
}
870+
871+
private fun sanitizeHtml(content: String): String = content.replace(Regex("(?i)<(html|head|title|body)[^>]*>.*?</\\1>|<(html|head|title|body)[^>]*>"), "")
689872
.replace(Regex("(?i)</?(html|head|title|body)>"), "")
690873

691874
/**
@@ -726,7 +909,7 @@ class WebsiteBuilder {
726909
stream.appendHTML().html {
727910
lang = "en"
728911
head {
729-
commonMeta()
912+
commonMeta(adSense = false)
730913
val title = "404 command not found | Linux Command Library"
731914
uncommonMeta(
732915
title = title,
@@ -868,7 +1051,7 @@ class WebsiteBuilder {
8681051
"<loc>https://linuxcommandlibrary.com/$urlPart</loc>" +
8691052
"</url>"
8701053

871-
private fun HEAD.commonMeta() {
1054+
private fun HEAD.commonMeta(adSense: Boolean = true) {
8721055
meta(charset = "utf-8")
8731056
meta(name = "viewport", content = "width=device-width, initial-scale=1")
8741057
link(rel = "apple-touch-icon", sizes = "180x180", href = "/apple-touch-icon.png")
@@ -877,10 +1060,13 @@ class WebsiteBuilder {
8771060
link(rel = "manifest", href = "/site.webmanifest")
8781061
meta(name = "msapplication-TileColor", content = "#da532c")
8791062
meta(name = "theme-color", content = "#ffffff")
880-
script {
881-
src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3003920357099437"
882-
async = true
883-
crossorigin = ScriptCrossorigin.anonymous
1063+
if (adSense) {
1064+
script {
1065+
src =
1066+
"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3003920357099437"
1067+
async = true
1068+
crossorigin = ScriptCrossorigin.anonymous
1069+
}
8841070
}
8851071
}
8861072

@@ -984,25 +1170,29 @@ class WebsiteBuilder {
9841170
}
9851171
}
9861172
footer {
987-
text("All man pages are copyrighted by their respective authors. Thanks to ")
988-
a {
989-
target = ATarget.blank
990-
rel = "noopener"
991-
href = "https://github.com/tldr-pages/tldr"
992-
text("TLDR")
993-
}
994-
text(" and ")
995-
a {
996-
target = ATarget.blank
997-
rel = "noopener"
998-
href = "https://www.commandlinefu.com"
999-
text("commandlinefu.com")
1000-
}
1001-
br
1002-
div {
1003-
style = "display: flex;flex-wrap: wrap;align-items: center;justify-content: center;"
1004-
text("Simon Schubert - info@linuxcommandlibrary.com ")
1173+
p {
1174+
a {
1175+
target = ATarget.self
1176+
rel = "noopener"
1177+
href = "/privacy-policy"
1178+
text("Privacy Policy")
1179+
}
1180+
text(" | ")
1181+
a {
1182+
target = ATarget.self
1183+
rel = "noopener"
1184+
href = "/terms-conditions"
1185+
text("Terms and Conditions")
1186+
}
1187+
text(" | ")
1188+
a {
1189+
target = ATarget.self
1190+
rel = "noopener"
1191+
href = "/contact"
1192+
text("Contact")
1193+
}
10051194
}
1195+
10061196
a("https://play.google.com/store/apps/details?id=com.inspiredandroid.linuxcommandbibliotheca") {
10071197
style = "margin-right: 4px;"
10081198
target = ATarget.blank
@@ -1270,7 +1460,7 @@ class WebsiteBuilder {
12701460
else -> throw Exception("${category.title} not found")
12711461
}
12721462

1273-
fun String.addAnchorAndCodeStyle(fileName: String): String {
1463+
private fun String.addAnchorAndCodeStyle(fileName: String): String {
12741464
var content = this
12751465
var matches = quoteRegex.findAll(content)
12761466
matches.forEach {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add new commands
2+
Upgrade sdks

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
kotlin = "2.1.20"
33
accompanistAppcompatTheme = "0.36.0"
44
activityCompose = "1.10.1"
5-
foundation = "1.7.8"
6-
gradle = "8.9.1"
5+
foundation = "1.8.0"
6+
gradle = "8.9.2"
77
json = "20250107"
88
koinCore = "4.0.4"
99
kotlinGradlePlugin = "2.1.20"
@@ -14,7 +14,7 @@ material = "1.7.8"
1414
navigationCompose = "2.8.9"
1515
preference = "1.2.1"
1616
sqldelight = "2.0.2"
17-
uiToolingPreview = "1.7.8"
17+
uiToolingPreview = "1.8.0"
1818
spotless = "7.0.3"
1919

2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)