baby frontend soundin good
parent
3a246f8b38
commit
d01a933b73
|
|
@ -37,11 +37,16 @@ gitlab() (
|
|||
local url="$1"
|
||||
local url_path="${url#http*://gitlab*.net/}"
|
||||
local project="${url_path%%/-/*}"
|
||||
local project="${project%%/tree/*}"
|
||||
local root="${url_path#*$project}"
|
||||
local root="${root#*/-/}"
|
||||
local root="${root#tree/}"
|
||||
local root="${root#blob/}"
|
||||
local root="${root#*/}"
|
||||
local root="${root#*/-}"
|
||||
if [ "$root" != "${root#/tree}" ]; then
|
||||
root="${root#/tree}"
|
||||
root="/${root#/*/}"
|
||||
fi
|
||||
local root="${root#/blob}"
|
||||
local root="${root#/}"
|
||||
log project=$project, root=$root, url=$url
|
||||
echo "$project"
|
||||
echo "$root"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ EOF
|
|||
}
|
||||
|
||||
test_url_to_project_root() {
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/tree/master | grep -q '^data-store/orchestration/runbooks$'
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/tree/master | tail -n 1 | grep ^$
|
||||
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/-/blob/master/Alerts/rems/README.md | grep -q 'data-store/orchestration/runbooks'
|
||||
gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/-/blob/master/Alerts/rems/README.md | grep -q 'Alerts/rems/README.md'
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ each() {
|
|||
source ./cache.sh
|
||||
set -e
|
||||
set -o pipefail
|
||||
log() { echo "> $*" >&2; }
|
||||
}
|
||||
|
||||
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<header>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/highlight.js/latest/highlight.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/highlight.js/latest/styles/github.min.css">
|
||||
</header>
|
||||
<body>
|
||||
<textarea id="my-text-area">
|
||||
# initial
|
||||
value
|
||||
</textarea>
|
||||
</body>
|
||||
<footer>
|
||||
<script>
|
||||
const easyMDE = new EasyMDE({
|
||||
autoDownloadFontAwesome: true,
|
||||
autofocus: true,
|
||||
autosave: {
|
||||
enabled: false,
|
||||
},
|
||||
element: document.getElementById('my-text-area'),
|
||||
forceSync: true,
|
||||
indentWithTabs: false,
|
||||
initialValue: "# initial\nvalue",
|
||||
showIcons: ["code", "table"],
|
||||
spellChecker: false,
|
||||
sideBySideFullscreen: false,
|
||||
tabSize: 3,
|
||||
previewImagesInEditor: true,
|
||||
insertTexts: {
|
||||
image: [""],
|
||||
link: ["[](", ")"],
|
||||
},
|
||||
lineNumbers: true,
|
||||
uploadImage: true,
|
||||
imageUploadEndpoint: "/api/v0/media", // POST wants {data: {filePath: "/..."}}
|
||||
imagePathAbsolute: true,
|
||||
renderingConfig: {
|
||||
codeSyntaxHighlighting: true,
|
||||
},
|
||||
})
|
||||
function logValue() {
|
||||
console.log(easyMDE.value())
|
||||
}
|
||||
logValue()
|
||||
</script>
|
||||
</footer>
|
||||
</html>
|
||||
Loading…
Reference in New Issue