From 1c88229d4e2d154fdbd0388ab27fd82ced4faa0f Mon Sep 17 00:00:00 2001 From: infi Date: Sat, 6 Jun 2026 06:55:44 +0200 Subject: [PATCH] chore: remove outdated markdown content --- .devcontainer/devcontainer.json | 7 +- .gitmodules | 3 - app/build.gradle.kts | 14 - app/src/main/assets/changelogs/renderer.html | 95 ----- app/src/main/assets/katex/katex.html | 54 --- app/src/main/assets/markdown/markdown.html | 206 ----------- app/src/main/cpp/CMakeLists.txt | 43 --- app/src/main/cpp/external/.gitkeep | 0 app/src/main/cpp/external/cmark | 1 - app/src/main/cpp/stendal/stendal.cpp | 162 --------- .../chat/stoat/activities/MainActivity.kt | 6 - .../java/chat/stoat/ndk/NativeLibraries.kt | 14 - app/src/main/java/chat/stoat/ndk/Stendal.kt | 42 --- compliance/libraries/cmark.json | 11 - compliance/libraries/katex.json | 20 -- compliance/libraries/micromark.json | 20 -- compliance/licenses/cmark.json | 6 - docs/src/content/docs/contributing/setup.mdx | 46 +-- scripts/download_deps.ts | 332 ------------------ 19 files changed, 12 insertions(+), 1070 deletions(-) delete mode 100644 app/src/main/assets/changelogs/renderer.html delete mode 100644 app/src/main/assets/katex/katex.html delete mode 100644 app/src/main/assets/markdown/markdown.html delete mode 100644 app/src/main/cpp/CMakeLists.txt delete mode 100644 app/src/main/cpp/external/.gitkeep delete mode 160000 app/src/main/cpp/external/cmark delete mode 100644 app/src/main/cpp/stendal/stendal.cpp delete mode 100644 app/src/main/java/chat/stoat/ndk/NativeLibraries.kt delete mode 100644 app/src/main/java/chat/stoat/ndk/Stendal.kt delete mode 100644 compliance/libraries/cmark.json delete mode 100644 compliance/libraries/katex.json delete mode 100644 compliance/libraries/micromark.json delete mode 100644 compliance/licenses/cmark.json delete mode 100644 scripts/download_deps.ts diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7b70f8bf..f18b63fc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,16 +1,13 @@ { "image": "mcr.microsoft.com/devcontainers/universal:2", "features": { - "ghcr.io/devcontainers-community/features/deno:1": {}, - "ghcr.io/nordcominc/devcontainer-features/android-sdk:1": { - "extra_packages": "ndk;28.1.13356709" - }, + "ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {}, "ghcr.io/devcontainers/features/java:1": { "version": "21", "jdkDistro": "oracle" } }, - "postCreateCommand": "chmod +x gradlew && deno run -A scripts/download_deps.ts --yes && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties && cp app/google-services.json.example app/google-services.json && git submodule update --init --recursive", + "postCreateCommand": "chmod +x gradlew && cp revoltbuild.properties.example revoltbuild.properties && cp sentry.properties.example sentry.properties && cp app/google-services.json.example app/google-services.json", "customizations": { "vscode": { "extensions": [ diff --git a/.gitmodules b/.gitmodules index b218abe7..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "app/src/main/cpp/external/cmark"] - path = app/src/main/cpp/external/cmark - url = https://github.com/commonmark/cmark diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 18042276..ab9dd7a6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -70,13 +70,6 @@ android { vectorDrawables { useSupportLibrary = true } - - externalNativeBuild { - cmake { - arguments += listOf("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON") - cppFlags("") - } - } } buildTypes { @@ -141,12 +134,6 @@ android { androidResources { generateLocaleConfig = true } - externalNativeBuild { - cmake { - path(file("src/main/cpp/CMakeLists.txt")) - version = "3.22.1" - } - } lint { abortOnError = false disable += "MissingTranslation" @@ -299,7 +286,6 @@ aboutLibraries { "BSD-2-Clause", "BSD-3-Clause", "The 3-Clause BSD License", "BSD License", - "cmark", "EPL-1.0", "MIT", "ML Kit Terms of Service", diff --git a/app/src/main/assets/changelogs/renderer.html b/app/src/main/assets/changelogs/renderer.html deleted file mode 100644 index 7232eb7c..00000000 --- a/app/src/main/assets/changelogs/renderer.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - -
- - - \ No newline at end of file diff --git a/app/src/main/assets/katex/katex.html b/app/src/main/assets/katex/katex.html deleted file mode 100644 index ac5baaca..00000000 --- a/app/src/main/assets/katex/katex.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - -
- - - \ No newline at end of file diff --git a/app/src/main/assets/markdown/markdown.html b/app/src/main/assets/markdown/markdown.html deleted file mode 100644 index a4f2794b..00000000 --- a/app/src/main/assets/markdown/markdown.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt deleted file mode 100644 index ec54fecf..00000000 --- a/app/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ - -# For more information about using CMake with Android Studio, read the -# documentation: https://d.android.com/studio/projects/add-native-code.html. -# For more examples on how to use CMake, see https://github.com/android/ndk-samples. - -# Sets the minimum CMake version required for this project. -cmake_minimum_required(VERSION 3.22.1) - -# Declares the project name. The project name can be accessed via ${ PROJECT_NAME}, -# Since this is the top level CMakeLists.txt, the project name is also accessible -# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level -# build script scope). -project("stoat") - -# Compile cmark in external/cmark -add_subdirectory(external/cmark) - -# Creates and names a library, sets it as either STATIC -# or SHARED, and provides the relative paths to its source code. -# You can define multiple libraries, and CMake builds them for you. -# Gradle automatically packages shared libraries with your APK. -# -# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define -# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME} -# is preferred for the same purpose. -# -# In order to load a library into your app from Java/Kotlin, you must call -# System.loadLibrary() and pass the name of the library defined here; -# for GameActivity/NativeActivity derived applications, the same library name must be -# used in the AndroidManifest.xml file. -add_library(stendal SHARED - # List C/C++ source files with relative paths to this CMakeLists.txt. - stendal/stendal.cpp -) - -# Specifies libraries CMake should link to your target library. You -# can link libraries from various origins, such as libraries defined in this -# build script, prebuilt third-party libraries, or Android system libraries. -target_link_libraries(stendal - # List libraries link to the target library - cmark - android - log) \ No newline at end of file diff --git a/app/src/main/cpp/external/.gitkeep b/app/src/main/cpp/external/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/app/src/main/cpp/external/cmark b/app/src/main/cpp/external/cmark deleted file mode 160000 index 3337a307..00000000 --- a/app/src/main/cpp/external/cmark +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3337a30715a641274a5a14aa167d6e51ba4066c0 diff --git a/app/src/main/cpp/stendal/stendal.cpp b/app/src/main/cpp/stendal/stendal.cpp deleted file mode 100644 index 7e7ed28b..00000000 --- a/app/src/main/cpp/stendal/stendal.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include - -#define STENDAL_ASTNODE_CONSTRUCTOR_SIGNATURE "(ILjava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V" - -namespace Stendal { - jclass arrayListClass = nullptr; - jmethodID constructArrayListMethod = nullptr; - jmethodID addArrayListMethod = nullptr; - jclass astNodeClass = nullptr; - jclass integerWrapperClass = nullptr; - jmethodID astNodeConstructor = nullptr; - jmethodID integerWrapperConstructor = nullptr; - jclass booleanWrapperClass = nullptr; - jmethodID booleanWrapperConstructor = nullptr; - - inline bool string_starts_with(std::string const &value, std::string const &prefix) { - return value.rfind(prefix, 0) == 0; - } - - inline bool string_ends_with(std::string const &value, std::string const &suffix) { - if (suffix.size() > value.size()) return false; - return std::equal(suffix.rbegin(), suffix.rend(), value.rbegin()); - } - - void init(JNIEnv *env) { - jclass localArrayListClass = env->FindClass("java/util/ArrayList"); - arrayListClass = (jclass) env->NewGlobalRef(localArrayListClass); - constructArrayListMethod = env->GetMethodID(localArrayListClass, "", "(I)V"); - addArrayListMethod = env->GetMethodID(localArrayListClass, "add", "(Ljava/lang/Object;)Z"); - - jclass localAstNodeClass = env->FindClass("chat/stoat/ndk/AstNode"); - astNodeClass = (jclass) env->NewGlobalRef(localAstNodeClass); - astNodeConstructor = env->GetMethodID(localAstNodeClass, "", - STENDAL_ASTNODE_CONSTRUCTOR_SIGNATURE); - - jclass localIntegerWrapperClass = env->FindClass("java/lang/Integer"); - integerWrapperClass = (jclass) env->NewGlobalRef(localIntegerWrapperClass); - integerWrapperConstructor = env->GetMethodID(localIntegerWrapperClass, "", "(I)V"); - - jclass localBooleanWrapperClass = env->FindClass("java/lang/Boolean"); - booleanWrapperClass = (jclass) env->NewGlobalRef(localBooleanWrapperClass); - booleanWrapperConstructor = env->GetMethodID(localBooleanWrapperClass, "", "(Z)V"); - } - - jobject node_instance(JNIEnv *env, cmark_node *node, jobject children) { - jstring typeStr = env->NewStringUTF(cmark_node_get_type_string(node)); - jstring literalStr = env->NewStringUTF(cmark_node_get_literal(node)); - jstring actionStr = env->NewStringUTF(cmark_node_get_url(node)); - jobject headingLevelIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_heading_level( - node)); - jobject listTypeIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_list_type(node)); - jobject delimiterTypeIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_list_delim( - node)); - jobject startIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_list_start(node)); - jobject tightBoln = env->NewObject(Stendal::booleanWrapperClass, - Stendal::booleanWrapperConstructor, - (bool) cmark_node_get_list_tight(node)); - jstring fenceStr = env->NewStringUTF(cmark_node_get_fence_info(node)); - jstring titleStr = env->NewStringUTF(cmark_node_get_title(node)); - jstring onEnterStr = env->NewStringUTF(cmark_node_get_on_enter(node)); - jstring onExitStr = env->NewStringUTF(cmark_node_get_on_exit(node)); - jobject startLineIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_start_line(node)); - jobject endLineIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_end_line(node)); - jobject startColumnIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_start_column( - node)); - jobject endColumnIntg = env->NewObject(Stendal::integerWrapperClass, - Stendal::integerWrapperConstructor, - (int) cmark_node_get_end_column(node)); - - jobject inst = env->NewObject(Stendal::astNodeClass, Stendal::astNodeConstructor, - (int) cmark_node_get_type(node), - typeStr, children, - literalStr, actionStr, headingLevelIntg, - listTypeIntg, delimiterTypeIntg, startIntg, tightBoln, - fenceStr, titleStr, onEnterStr, onExitStr, startLineIntg, - endLineIntg, - startColumnIntg, endColumnIntg); - - env->DeleteLocalRef(typeStr); - env->DeleteLocalRef(literalStr); - env->DeleteLocalRef(actionStr); - env->DeleteLocalRef(headingLevelIntg); - env->DeleteLocalRef(listTypeIntg); - env->DeleteLocalRef(delimiterTypeIntg); - env->DeleteLocalRef(startIntg); - env->DeleteLocalRef(tightBoln); - env->DeleteLocalRef(fenceStr); - env->DeleteLocalRef(titleStr); - env->DeleteLocalRef(onEnterStr); - env->DeleteLocalRef(onExitStr); - env->DeleteLocalRef(startLineIntg); - env->DeleteLocalRef(endLineIntg); - env->DeleteLocalRef(startColumnIntg); - env->DeleteLocalRef(endColumnIntg); - - return inst; - } - - jobject collect_nodes(JNIEnv *env, cmark_node *doc) { - std::vector> children; - - { - cmark_node *child = cmark_node_first_child(doc); - while (child) { - children.push_back(std::pair(child, Stendal::collect_nodes(env, child))); - child = cmark_node_next(child); - } - } - - jobject list = env->NewObject(Stendal::arrayListClass, Stendal::constructArrayListMethod, - (int) children.size()); - - for (auto child: children) { - jobject inst = Stendal::node_instance(env, child.first, child.second); - env->DeleteLocalRef(child.second); - env->CallBooleanMethod(list, Stendal::addArrayListMethod, inst); - env->DeleteLocalRef(inst); - } - - return list; - } -} - -extern "C" -JNIEXPORT void JNICALL -Java_chat_stoat_ndk_Stendal_init(JNIEnv *env, [[maybe_unused]] jobject thiz) { - Stendal::init(env); -} - -extern "C" JNIEXPORT jobject JNICALL -Java_chat_stoat_ndk_Stendal_render(JNIEnv *env, [[maybe_unused]] jobject thiz, jstring input) { - const char *inputStr = env->GetStringUTFChars(input, nullptr); - cmark_node *doc = cmark_parse_document(inputStr, strlen(inputStr), - CMARK_OPT_DEFAULT | CMARK_OPT_HARDBREAKS | - CMARK_OPT_VALIDATE_UTF8); - - jobject nodes = Stendal::collect_nodes(env, doc); - jobject inst = Stendal::node_instance(env, doc, nodes); - - cmark_node_free(doc); - env->ReleaseStringUTFChars(input, inputStr); - - return inst; -} \ No newline at end of file diff --git a/app/src/main/java/chat/stoat/activities/MainActivity.kt b/app/src/main/java/chat/stoat/activities/MainActivity.kt index 325b3ffb..125bbd91 100644 --- a/app/src/main/java/chat/stoat/activities/MainActivity.kt +++ b/app/src/main/java/chat/stoat/activities/MainActivity.kt @@ -90,7 +90,6 @@ import chat.stoat.composables.voice.VoicePermissionSwitch import chat.stoat.composables.voice.VoiceSheet import chat.stoat.core.model.schemas.HealthNotice import chat.stoat.material.EasingTokens -import chat.stoat.ndk.NativeLibraries import chat.stoat.persistence.KVStorage import chat.stoat.screens.DefaultDestinationScreen import chat.stoat.screens.about.AboutScreen @@ -422,11 +421,6 @@ class MainActivity : AppCompatActivity() { data?.add(messaging) } - companion object { - init { - NativeLibraries.init() - } - } } val StoatTweenInt: FiniteAnimationSpec = tween(400, easing = EaseInOutExpo) diff --git a/app/src/main/java/chat/stoat/ndk/NativeLibraries.kt b/app/src/main/java/chat/stoat/ndk/NativeLibraries.kt deleted file mode 100644 index 093a514f..00000000 --- a/app/src/main/java/chat/stoat/ndk/NativeLibraries.kt +++ /dev/null @@ -1,14 +0,0 @@ -package chat.stoat.ndk - -annotation class NativeLibrary(val name: String) { - companion object { - const val LIB_NAME_NATIVE_MARKDOWN = "stendal" - } -} - -object NativeLibraries { - fun init() { - System.loadLibrary(NativeLibrary.LIB_NAME_NATIVE_MARKDOWN) - Stendal.init() - } -} diff --git a/app/src/main/java/chat/stoat/ndk/Stendal.kt b/app/src/main/java/chat/stoat/ndk/Stendal.kt deleted file mode 100644 index 19694075..00000000 --- a/app/src/main/java/chat/stoat/ndk/Stendal.kt +++ /dev/null @@ -1,42 +0,0 @@ -package chat.stoat.ndk - -import kotlinx.serialization.Serializable - -object AstNodeListType { - const val NONE = 0 - const val BULLET = 1 - const val ORDERED = 2 -} - -object AstNodeDelimiterType { - const val NONE = 0 - const val PERIOD = 1 - const val PARENTHESIS = 2 -} - -@Serializable -data class AstNode( - val type: Int, - val stringType: String, - val children: List?, - val text: String?, - val url: String?, - val level: Int?, - val listType: Int?, - val delimiterType: Int?, - val listStart: Int?, - val listTight: Boolean?, - val fence: String?, - val title: String?, - val onEnter: String?, - val onExit: String?, - val startLine: Int?, - val endLine: Int?, - val startColumn: Int?, - val endColumn: Int?, -) - -object Stendal { - external fun init() - external fun render(input: String): AstNode -} \ No newline at end of file diff --git a/compliance/libraries/cmark.json b/compliance/libraries/cmark.json deleted file mode 100644 index c98c2420..00000000 --- a/compliance/libraries/cmark.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "uniqueId": "org.commonmark.cmark:cmark:0.0.0", - "developers": [], - "artifactVersion": "0.0.0", - "description": "CommonMark parsing and rendering library and program in C", - "name": "cmark", - "website": "https://github.com/commonmark/cmark", - "licenses": [ - "cmark" - ] -} \ No newline at end of file diff --git a/compliance/libraries/katex.json b/compliance/libraries/katex.json deleted file mode 100644 index 880adfe2..00000000 --- a/compliance/libraries/katex.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "uniqueId": "org.katex:katex:0.0.0", - "developers": [ - { - "name": "Khan Academy", - "organisationUrl": "https://www.khanacademy.org/" - }, - { - "name": "The Katex Team", - "organisationUrl": "https://katex.org/" - } - ], - "artifactVersion": "0.0.0", - "description": "KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.", - "name": "KaTeX", - "website": "https://katex.org/", - "licenses": [ - "MIT" - ] -} \ No newline at end of file diff --git a/compliance/libraries/micromark.json b/compliance/libraries/micromark.json deleted file mode 100644 index d546e8fc..00000000 --- a/compliance/libraries/micromark.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "uniqueId": "com.unifiedjs.micromark:micromark:0.0.0", - "developers": [ - { - "name": "Unified", - "organisationUrl": "https://unifiedjs.com/" - }, - { - "name": "The micromark Contributors", - "organisationUrl": "https://github.com/micromark/micromark/graphs/contributors" - } - ], - "artifactVersion": "0.0.0", - "description": "small, safe, and great commonmark (optionally gfm) compliant markdown parser", - "name": "micromark", - "website": "https://github.com/micromark/micromark", - "licenses": [ - "MIT" - ] -} \ No newline at end of file diff --git a/compliance/licenses/cmark.json b/compliance/licenses/cmark.json deleted file mode 100644 index 6c21bed9..00000000 --- a/compliance/licenses/cmark.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "content": "Copyright (c) 2014, John MacFarlane\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n-----\n\nhoudini.h, houdini_href_e.c, houdini_html_e.c, houdini_html_u.c\n\nderive from https://github.com/vmg/houdini (with some modifications)\n\nCopyright (C) 2012 Vicent Martí\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n-----\n\nbuffer.h, buffer.c, chunk.h\n\nare derived from code (C) 2012 Github, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n-----\n\nutf8.c and utf8.c\n\nare derived from utf8proc\n(),\n(C) 2009 Public Software Group e. V., Berlin, Germany.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n\n-----\n\nThe normalization code in normalize.py was derived from the\nmarkdowntest project, Copyright 2013 Karl Dubost:\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Karl Dubost\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-----\n\nThe CommonMark spec (test/spec.txt) is\n\nCopyright (C) 2014-15 John MacFarlane\n\nReleased under the Creative Commons CC-BY-SA 4.0 license:\n.\n\n-----\n\nThe test software in test/ is\n\nCopyright (c) 2014, John MacFarlane\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", - "hash": "cmark", - "url": "https://github.com/commonmark/cmark/blob/master/COPYING", - "name": "cmark COPYING file" -} \ No newline at end of file diff --git a/docs/src/content/docs/contributing/setup.mdx b/docs/src/content/docs/contributing/setup.mdx index 2efc0901..c3604747 100644 --- a/docs/src/content/docs/contributing/setup.mdx +++ b/docs/src/content/docs/contributing/setup.mdx @@ -11,7 +11,7 @@ If you want to compile the app yourself, you can follow these guidelines. You ma :::danger It may be tempting to skip some of these steps, but make sure you follow them to ensure that your development environment is set up correctly. -Note: If you are doing this in Github Codespaces, steps 1-10 will be done for you. Also note that while small codespace instances can build this app, it's recommend to use 8-core or above for best results. +Note: If you are doing this in Github Codespaces, steps 1-9 will be done for you. Also note that while small codespace instances can build this app, it's recommend to use 8-core or above for best results. ::: import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" @@ -80,47 +80,21 @@ import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" -3. Download [Deno](https://deno.com). - - _Please see the [Deno Runtime Manual](https://docs.deno.com/runtime/getting_started/installation/) for installation guidance._ - -4. Clone the repository. +3. Clone the repository. ```sh - git clone --recursive https://github.com/stoatchat/for-android.git + git clone https://github.com/stoatchat/for-android.git ``` - Specify `--recursive` to ensure that submodules are cloned as well. +4. Open the project in Android Studio. -5. Open the project in Android Studio. - -6. Install the required dependencies. +5. Install the required dependencies. - Android SDK, latest version - - Android NDK, latest version You can install these from the SDK Manager in Android Studio. -7. Download required additional, embedded dependencies using the provided script. - - ```sh - deno run -A scripts/download_deps.ts - ``` - - :::tip - You can run this script with the `-y` flag to skip confirmation - prompts. - ::: - - :::note - This script will query the Stoat version control server for the latest version of the - final-markdown native library and download it. If you do not wish to use pre-built libraries, - you can build final-markdown yourself from the source code at https://git.revolt.chat/android/final-markdown, - and copy the files to the `app/src/main/jniLibs` folder. Note the files that are downloaded are - exactly the same as the ones we use for the app on Google Play, so you can be sure they are safe to use. - ::: - -8. Copy the `stoatbuild.properties.example` file to `stoatbuild.properties` and fill in the required values. +6. Copy the `stoatbuild.properties.example` file to `stoatbuild.properties` and fill in the required values. ```sh cp stoatbuild.properties.example stoatbuild.properties @@ -135,7 +109,7 @@ import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" | `build.debug.app_name` | The name of the app in debug builds, arbitrary | | `build.flavour_id` | Leave as `ZZUU` | -9. Copy the `sentry.properties.example` file to `sentry.properties` and fill in the required values. +7. Copy the `sentry.properties.example` file to `sentry.properties` and fill in the required values. ```sh cp sentry.properties.example sentry.properties @@ -152,7 +126,7 @@ import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" You can get these values from the Sentry dashboard. -10. Copy the `google-services.json.example` file within the `app` directory to `google-services.json`. +8. Copy the `google-services.json.example` file within the `app` directory to `google-services.json`. Firebase services are integrated into the project, so we need a `google-services.json` file for the build to succeed. For development purposes, use the provided example file: @@ -164,7 +138,7 @@ import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" This is a mock configuration file for development purposes only. In a production environment, you would use a real Firebase project configuration. ::: -11. Build the project. +9. Build the project. You can build the project by clicking on the 'Run' button in Android Studio. If asked, build the `:app` module. @@ -172,6 +146,6 @@ import { Tabs, TabItem, Steps } from "@astrojs/starlight/components" If building within Github Codespaces, you can build a fresh debug apk by running `./gradlew assembledebug --no-daemon` from the root of the project. Upon completion, the apk will be within `app/build/outputs/apk/debug/` -12. **You're all set!** You can now start contributing to Stoat for Android. +10. **You're all set!** You can now start contributing to Stoat for Android. \ No newline at end of file diff --git a/scripts/download_deps.ts b/scripts/download_deps.ts deleted file mode 100644 index 8b705f5b..00000000 --- a/scripts/download_deps.ts +++ /dev/null @@ -1,332 +0,0 @@ -import { resolve } from "jsr:@std/path" -import { parseArgs } from "jsr:@std/cli/parse-args" - -const args = parseArgs(Deno.args, { - boolean: ["yes", "y", "auto-accept"], - alias: { - "y": "yes" - } -}) - -const autoAccept = args.yes || args["auto-accept"] - -const outputFolderParent = resolve(Deno.cwd(), "app", "src", "main", "assets") -try { - Deno.statSync(outputFolderParent) -} catch (_) { - console.error( - "\x1b[31m" + // red - "Did you run this script from the correct directory?" + - "\x1b[0m" - ) - console.error( - "Usage: " + - "\x1b[35m" + // magenta - "deno run -A scripts/download_deps.ts [--yes|-y|--auto-accept]" + - "\x1b[0m" + - " from the " + - "\x1b[1;31;4m" + // bold red underline - "root" + - "\x1b[0m" + - " directory of the project." - ) - Deno.exit(1) -} - -const outputFolder = resolve(outputFolderParent, "embedded") - -// If it exists, delete it -try { - Deno.removeSync(outputFolder, { recursive: true }) -} catch (_) { - // Ignore, might not exist -} - -// Create the output folder -Deno.mkdirSync(outputFolder, { recursive: true }) - -const deps = [ - { - file: "katex.min.css", - url: "https://cdn.jsdelivr.net/npm/katex@0.16.19/dist/katex.min.css", - }, - { - file: "katex.min.js", - url: "https://cdn.jsdelivr.net/npm/katex@0.16.19/dist/katex.min.js", - }, - { - file: "fonts/KaTeX_AMS-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_AMS-Regular.ttf", - }, - { - file: "fonts/KaTeX_AMS-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_AMS-Regular.woff", - }, - { - file: "fonts/KaTeX_AMS-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_AMS-Regular.woff2", - }, - { - file: "fonts/KaTeX_Caligraphic-Bold.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Caligraphic-Bold.ttf", - }, - { - file: "fonts/KaTeX_Caligraphic-Bold.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Caligraphic-Bold.woff", - }, - { - file: "fonts/KaTeX_Caligraphic-Bold.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Caligraphic-Bold.woff2", - }, - { - file: "fonts/KaTeX_Caligraphic-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Caligraphic-Regular.ttf", - }, - { - file: "fonts/KaTeX_Caligraphic-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Caligraphic-Regular.woff", - }, - { - file: "fonts/KaTeX_Caligraphic-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Caligraphic-Regular.woff2", - }, - { - file: "fonts/KaTeX_Fraktur-Bold.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Fraktur-Bold.ttf", - }, - { - file: "fonts/KaTeX_Fraktur-Bold.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Fraktur-Bold.woff", - }, - { - file: "fonts/KaTeX_Fraktur-Bold.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Fraktur-Bold.woff2", - }, - { - file: "fonts/KaTeX_Fraktur-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Fraktur-Regular.ttf", - }, - { - file: "fonts/KaTeX_Fraktur-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Fraktur-Regular.woff", - }, - { - file: "fonts/KaTeX_Fraktur-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Fraktur-Regular.woff2", - }, - { - file: "fonts/KaTeX_Main-Bold.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Bold.ttf", - }, - { - file: "fonts/KaTeX_Main-Bold.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Bold.woff", - }, - { - file: "fonts/KaTeX_Main-Bold.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Bold.woff2", - }, - { - file: "fonts/KaTeX_Main-BoldItalic.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-BoldItalic.ttf", - }, - { - file: "fonts/KaTeX_Main-BoldItalic.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-BoldItalic.woff", - }, - { - file: "fonts/KaTeX_Main-BoldItalic.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-BoldItalic.woff2", - }, - { - file: "fonts/KaTeX_Main-Italic.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Italic.ttf", - }, - { - file: "fonts/KaTeX_Main-Italic.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Italic.woff", - }, - { - file: "fonts/KaTeX_Main-Italic.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Italic.woff2", - }, - { - file: "fonts/KaTeX_Main-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Regular.ttf", - }, - { - file: "fonts/KaTeX_Main-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Regular.woff", - }, - { - file: "fonts/KaTeX_Main-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Main-Regular.woff2", - }, - { - file: "fonts/KaTeX_Math-BoldItalic.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Math-BoldItalic.ttf", - }, - { - file: "fonts/KaTeX_Math-BoldItalic.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Math-BoldItalic.woff", - }, - { - file: "fonts/KaTeX_Math-BoldItalic.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Math-BoldItalic.woff2", - }, - { - file: "fonts/KaTeX_Math-Italic.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Math-Italic.ttf", - }, - { - file: "fonts/KaTeX_Math-Italic.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Math-Italic.woff", - }, - { - file: "fonts/KaTeX_Math-Italic.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Math-Italic.woff2", - }, - { - file: "fonts/KaTeX_SansSerif-Bold.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Bold.ttf", - }, - { - file: "fonts/KaTeX_SansSerif-Bold.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Bold.woff", - }, - { - file: "fonts/KaTeX_SansSerif-Bold.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Bold.woff2", - }, - { - file: "fonts/KaTeX_SansSerif-Italic.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Italic.ttf", - }, - { - file: "fonts/KaTeX_SansSerif-Italic.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Italic.woff", - }, - { - file: "fonts/KaTeX_SansSerif-Italic.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Italic.woff2", - }, - { - file: "fonts/KaTeX_SansSerif-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Regular.ttf", - }, - { - file: "fonts/KaTeX_SansSerif-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Regular.woff", - }, - { - file: "fonts/KaTeX_SansSerif-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_SansSerif-Regular.woff2", - }, - { - file: "fonts/KaTeX_Script-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Script-Regular.ttf", - }, - { - file: "fonts/KaTeX_Script-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Script-Regular.woff", - }, - { - file: "fonts/KaTeX_Script-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Script-Regular.woff2", - }, - { - file: "fonts/KaTeX_Size1-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size1-Regular.ttf", - }, - { - file: "fonts/KaTeX_Size1-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size1-Regular.woff", - }, - { - file: "fonts/KaTeX_Size1-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size1-Regular.woff2", - }, - { - file: "fonts/KaTeX_Size2-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size2-Regular.ttf", - }, - { - file: "fonts/KaTeX_Size2-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size2-Regular.woff", - }, - { - file: "fonts/KaTeX_Size2-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size2-Regular.woff2", - }, - { - file: "fonts/KaTeX_Size3-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size3-Regular.ttf", - }, - { - file: "fonts/KaTeX_Size3-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size3-Regular.woff", - }, - { - file: "fonts/KaTeX_Size3-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size3-Regular.woff2", - }, - { - file: "fonts/KaTeX_Size4-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size4-Regular.ttf", - }, - { - file: "fonts/KaTeX_Size4-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size4-Regular.woff", - }, - { - file: "fonts/KaTeX_Size4-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Size4-Regular.woff2", - }, - { - file: "fonts/KaTeX_Typewriter-Regular.ttf", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Typewriter-Regular.ttf", - }, - { - file: "fonts/KaTeX_Typewriter-Regular.woff", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Typewriter-Regular.woff", - }, - { - file: "fonts/KaTeX_Typewriter-Regular.woff2", - url: "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/fonts/KaTeX_Typewriter-Regular.woff2", - }, - { - file: "micromark.bundle.js", - url: "https://esm.sh/v135/micromark@3.2.0/es2022/micromark.bundle.mjs", - }, - { - file: "micromark-gfm.bundle.js", - url: "https://esm.sh/v135/micromark-extension-gfm@3.0.0/es2022/micromark-extension-gfm.bundle.mjs", - } -] - -for (const dep of deps) { - console.log(`- ${dep.file} from ${dep.url}`) -} - -if (!autoAccept) { - console.log("Will download the above files.") - if (!confirm("Continue?")) { - console.log("Aborted.") - Deno.exit(0) - } -} else { - console.log("Will download the above files. (auto-accepted)") -} - -const fontsFolder = resolve(outputFolder, "fonts") -Deno.mkdirSync(fontsFolder, { recursive: true }) - -for (const dep of deps) { - const response = await fetch(dep.url) - const data = await response.arrayBuffer() - const file = resolve(outputFolder, dep.file) - Deno.writeFileSync(file, new Uint8Array(data)) - console.log(`Downloaded ${dep.file} to ${file}`) -} - -