improve readme readability
This commit is contained in:
+55
-10
@@ -263,26 +263,71 @@ Page {
|
|||||||
parent: window.overlay
|
parent: window.overlay
|
||||||
x: (parent.width - width) / 2
|
x: (parent.width - width) / 2
|
||||||
y: (parent.height - height) / 2
|
y: (parent.height - height) / 2
|
||||||
|
width: Math.min(800, parent.width * 0.75)
|
||||||
|
height: Math.min(600, parent.height * 0.75)
|
||||||
title: addon?qsTr("%1 Readme").arg(addon.name):""
|
title: addon?qsTr("%1 Readme").arg(addon.name):""
|
||||||
standardButtons: Dialog.Close
|
standardButtons: Dialog.Close
|
||||||
ScrollView{
|
ScrollView {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
TextArea {
|
contentWidth: parent.width
|
||||||
text: readmeDialog.addon?readmeDialog.addon.readme:""
|
ColumnLayout {
|
||||||
readOnly: true
|
width: parent.width
|
||||||
anchors.fill: parent
|
Label {
|
||||||
wrapMode: Text.NoWrap
|
id: readmeLabel
|
||||||
font.family: "Hack"
|
Layout.fillWidth: true
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
textFormat: Text.MarkdownText
|
||||||
|
|
||||||
|
Layout.maximumWidth: parent.width
|
||||||
|
|
||||||
|
font.pixelSize: 14
|
||||||
|
|
||||||
|
topPadding: 15
|
||||||
|
bottomPadding: 15
|
||||||
|
leftPadding: 10
|
||||||
|
rightPadding: 10
|
||||||
|
|
||||||
|
text: {
|
||||||
|
let rawText = readmeDialog.addon ? readmeDialog.addon.readme : "";
|
||||||
|
return rawText.replace(/<[^>]*>/g, '');
|
||||||
|
let listText = cleanText.replace(/\|(.*)\|(.*)\|/g, (match, p1, p2) => {
|
||||||
|
if (p1.includes("---")) return "";
|
||||||
|
return "• **" + p1.trim() + "**: " + p2.trim();
|
||||||
|
});
|
||||||
|
return listText;
|
||||||
|
}
|
||||||
|
|
||||||
|
baseUrl: {
|
||||||
|
if (readmeDialog.addon) {
|
||||||
|
// 1. Remove the ".git" from the end of the repository URL
|
||||||
|
let cleanUrl = readmeDialog.addon.getUrl().toString().replace(".git", "");
|
||||||
|
|
||||||
|
// 2. Get the current branch (e.g., "master" or "main")
|
||||||
|
let branch = readmeDialog.addon.currentBranch;
|
||||||
|
if (branch === "") branch = "master"; // Fallback
|
||||||
|
|
||||||
|
// 3. Construct the GitHub raw content link
|
||||||
|
// Result: https://github.com/user/repo/raw/master/
|
||||||
|
return cleanUrl + "/raw/" + branch + "/";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
onLinkActivated: function(link) { Qt.openUrlExternally(link) }
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Dialog {
|
Dialog {
|
||||||
property Addon addon
|
property Addon addon
|
||||||
property alias newUrlText: urlInput.text
|
property alias newUrlText: urlInput.text
|
||||||
id: urlDialog
|
id: urlDialog
|
||||||
parent: window.overlay
|
parent: window.overlay
|
||||||
x: (parent.width - width) / 1.5
|
x: (parent.width - width) / 2
|
||||||
y: (parent.height - height) / 2
|
y: (parent.height - height) / 2
|
||||||
|
width: Math.min(500, parent.width * 0.75)
|
||||||
title: addon ? qsTr("Change URL for %1").arg(addon.name) : ""
|
title: addon ? qsTr("Change URL for %1").arg(addon.name) : ""
|
||||||
standardButtons: Dialog.Save | Dialog.Cancel
|
standardButtons: Dialog.Save | Dialog.Cancel
|
||||||
|
|
||||||
|
|||||||
+9
-3
@@ -24,6 +24,12 @@ if(GIT_EXECUTABLE)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
string(REGEX REPLACE "^v" "" CLEAN_APP_VERSION "${RAW_GIT_VERSION}")
|
||||||
|
|
||||||
|
if(NOT CLEAN_APP_VERSION)
|
||||||
|
set(CLEAN_APP_VERSION "1.0.0")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(LIBGIT2 REQUIRED IMPORTED_TARGET libgit2)
|
pkg_check_modules(LIBGIT2 REQUIRED IMPORTED_TARGET libgit2)
|
||||||
@@ -174,11 +180,11 @@ if(NOT WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
set(CPACK_GENERATOR "NSIS") # or "ZIP" for a simple zip
|
set(CPACK_GENERATOR "NSIS")
|
||||||
set(CPACK_PACKAGE_NAME "GitAddonsManager")
|
set(CPACK_PACKAGE_NAME "GitAddonsManager")
|
||||||
set(CPACK_PACKAGE_VERSION "1.0.0")
|
set(CPACK_PACKAGE_VERSION "{CLEAN_APP_VERSION}")
|
||||||
set(CPACK_PACKAGE_EXECUTABLES "GitAddonsManager" "GitAddonsManager")
|
set(CPACK_PACKAGE_EXECUTABLES "GitAddonsManager" "GitAddonsManager")
|
||||||
set(CPACK_PACKAGE_FILE_NAME "GitAddonsManager_Setup")
|
set(CPACK_PACKAGE_FILE_NAME "GitAddonsManager-${CLEAN_APP_VERSION}")
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
||||||
qt_finalize_executable(GitAddonsManager)
|
qt_finalize_executable(GitAddonsManager)
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
name: Build and Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-release:
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up MSVC (Visual Studio Compiler)
|
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
|
|
||||||
- name: Cache Qt
|
|
||||||
id: cache-qt
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ${{ github.workspace }}/Qt
|
|
||||||
key: qt-6.8.3-msvc2022_64
|
|
||||||
|
|
||||||
- name: Install Qt via aqtinstall
|
|
||||||
if: steps.cache-qt.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install aqtinstall
|
|
||||||
python -m aqt install-qt windows desktop 6.8.3 win64_msvc2022_64 --outputdir ${{ github.workspace }}/Qt
|
|
||||||
|
|
||||||
- name: Add Qt to PATH
|
|
||||||
run: |
|
|
||||||
echo "${{ github.workspace }}/Qt/6.8.3/msvc2022_64/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Install libgit2 via vcpkg
|
|
||||||
run: |
|
|
||||||
vcpkg install libgit2:x64-windows
|
|
||||||
|
|
||||||
- name: Configure CMake
|
|
||||||
run: |
|
|
||||||
$version = "${{ github.ref_name }}" -replace '^v', ''
|
|
||||||
cmake -B build -S . `
|
|
||||||
-DCMAKE_BUILD_TYPE=Release `
|
|
||||||
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/Qt/6.8.3/msvc2022_64" `
|
|
||||||
-DLIBGIT2_INCLUDE_DIR="C:/vcpkg/installed/x64-windows/include" `
|
|
||||||
-DLIBGIT2_LIBRARY="C:/vcpkg/installed/x64-windows/lib/git2.lib" `
|
|
||||||
-DCPACK_PACKAGE_VERSION="$version"
|
|
||||||
|
|
||||||
- name: Build Project
|
|
||||||
run: |
|
|
||||||
cmake --build build --config Release
|
|
||||||
|
|
||||||
- name: Install NSIS
|
|
||||||
run: choco install nsis -y
|
|
||||||
|
|
||||||
- name: Run CPack (Generate Installer)
|
|
||||||
working-directory: build
|
|
||||||
run: |
|
|
||||||
cpack -C Release
|
|
||||||
|
|
||||||
- name: Upload build artifacts on failure
|
|
||||||
if: failure()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: build-logs
|
|
||||||
path: build/
|
|
||||||
|
|
||||||
- name: Upload Artifacts to Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: build/GitAddonsManager_Setup.exe
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -162,12 +162,12 @@ ApplicationWindow {
|
|||||||
text: "Author: woblight - minor update by Zae"
|
text: "Author: woblight - minor update by Zae"
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: "Source code: <a href=\"https://github.com/thezephyrsong/GitAddonsManager/\">GitLab</a>"
|
text: "Source code: <a href=\"https://github.com/thezephyrsong/GitAddonsManager/\">GitHub</a>"
|
||||||
onLinkActivated: Qt.openUrlExternally(link)
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: "Report an issue: <a href=\"https://github.com/thezephyrsong/GitAddonsManager/issues/\">GitLab</a>"
|
text: "Report an issue: <a href=\"https://github.com/thezephyrsong/GitAddonsManager/issues/\">GitHub</a>"
|
||||||
onLinkActivated: Qt.openUrlExternally(link)
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user