From cc7c876dd96c99620e341330fa8da9c209f229b5 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 25 Dec 2023 14:25:04 +0000 Subject: [PATCH] Check markdown files for syntax - Include markdown checks using mdl - different methods are used for local checks and GitHub actions - Fix syntax errors in some .md files --- .github/workflows/check-build-actions.yml | 7 ++++++ .mdl.rb | 7 ++++++ .mdlrc | 3 +++ DEVELOPER-NOTES.md | 21 ++++++++++------- README.md | 1 - doxygen.conf | 1 + meson.build | 28 +++++++++++++++++++++++ 7 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 .mdl.rb create mode 100644 .mdlrc diff --git a/.github/workflows/check-build-actions.yml b/.github/workflows/check-build-actions.yml index 3bd3425c..598303e0 100644 --- a/.github/workflows/check-build-actions.yml +++ b/.github/workflows/check-build-actions.yml @@ -2,6 +2,13 @@ name: Geeqie check build run-name: ${{ github.actor }} is running Geeqie check build on: [push, pull_request] jobs: + Check-Markdown: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + - name: Run Markdown Lint + uses: actionshub/markdownlint@main + Check-Build-No-Options: runs-on: ubuntu-22.04 steps: diff --git a/.mdl.rb b/.mdl.rb new file mode 100644 index 00000000..67e0157d --- /dev/null +++ b/.mdl.rb @@ -0,0 +1,7 @@ +# Style settings for markdownlint (mdl) + +all +rule 'MD007', :indent => 4 +rule 'MD009', :br_spaces => 2 +rule 'MD010', :code_blocks => true +exclude_rule 'MD013' diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 00000000..a2e7196b --- /dev/null +++ b/.mdlrc @@ -0,0 +1,3 @@ +# markdownlint (mdl) configuration file + +style '.mdl.rb' diff --git a/DEVELOPER-NOTES.md b/DEVELOPER-NOTES.md index a78d3247..3a9f2b80 100644 --- a/DEVELOPER-NOTES.md +++ b/DEVELOPER-NOTES.md @@ -1,21 +1,25 @@ # Additional Information for Developers - ## Non-standard icons -#### Collection drag-drop icon +### Collection drag-drop icon #### ![][image_ref_gq_marker_png] + Used when dropping images onto a Collection. Defined in `./src/icons/gq-marker.xpm`. -#### Overlay Screen Display icons +### Overlay Screen Display icons + +#### ![][image_ref_image_osd_color_png] IMAGE_OSD_COLOR + +#### ![][image_ref_image_osd_first_png] IMAGE_OSD_FIRST -##### ![][image_ref_image_osd_color_png] IMAGE_OSD_COLOR -##### ![][image_ref_image_osd_first_png] IMAGE_OSD_FIRST -##### ![][image_ref_image_osd_icon_png] IMAGE_OSD_ICON -##### ![][image_ref_image_osd_last_png] IMAGE_OSD_LAST -##### ![][image_ref_image_osd_rotate_auto_png] IMAGE_OSD_ROTATE_AUTO +#### ![][image_ref_image_osd_icon_png] IMAGE_OSD_ICON + +#### ![][image_ref_image_osd_last_png] IMAGE_OSD_LAST + +#### ![][image_ref_image_osd_rotate_auto_png] IMAGE_OSD_ROTATE_AUTO Shown in the Overlay Screen Display. Defined in `./src/image-overlay.cc image_osd_icon_pixbuf()`. @@ -24,6 +28,7 @@ Shown in the Overlay Screen Display. Defined in `./src/image-overlay.cc image_os Menu processing is in `./src/layout-util.cc menu_entries[]`. ## Doxygen Documentation + Complete code documentation in html format can be generated via the script `./scripts/doxygen.sh`. [image_ref_image_osd_color_png]: diff --git a/README.md b/README.md index fe960362..4c7a0256 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ Package Status: Geeqie website status: [![Links Status](https://github.com/geeqie/geeqie.github.io/actions/workflows/links.yml/badge.svg)]() - ## ![][image_ref_geeqie_png] Geeqie - an image viewer This is Geeqie, a successor of GQview. diff --git a/doxygen.conf b/doxygen.conf index 57640cbf..d867f432 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -924,6 +924,7 @@ FILE_PATTERNS = *.c \ *.m \ *.markdown \ *.md \ + *.rb \ *.mm \ *.dox \ *.py \ diff --git a/meson.build b/meson.build index a77a108a..b0c8f13e 100644 --- a/meson.build +++ b/meson.build @@ -633,6 +633,9 @@ configure_file(input : 'config.h.in', script_sources = [] subdir('scripts') +# For markdownlint on .md files +mdl_sources = [] + # For gtk builder checks on .ui files ui_sources = [] @@ -721,6 +724,31 @@ else summary({'shellcheck' : ['Test runs:', false]}, section : 'Testing', bool_yn : true) endif +# Markdownlint +option = get_option('archive') +if option.disabled() + mdl_exe = find_program('mdl', required : false) + + if mdl_exe.found() + mdl_sources += files('CHECKLIST.md', + 'CODING.md', + 'DEVELOPER-NOTES.md', + 'README.md', + join_paths(meson.project_source_root(), '.github', 'ISSUE_TEMPLATE.md')) + + style = join_paths(meson.project_source_root(), '.mdl.rb') + foreach md_file : mdl_sources + md_path = '@0@'.format(md_file) + test('Mdl_check_ ' + md_path, mdl_exe, args: ['--style', style, md_file], timeout: 100) + endforeach + summary({'markdownlint' : ['Test runs:', true]}, section : 'Testing', bool_yn : true) + else + summary({'markdownlint' : ['Test runs:', false]}, section : 'Testing', bool_yn : true) + endif +else + summary({'markdownlint' : ['Test runs:', false]}, section : 'Testing', bool_yn : true) +endif + # GtkBuilder .ui check option = get_option('archive') if option.disabled() -- 2.20.1