{"id":20408996,"url":"https://github.com/justmars/django-highlights","last_synced_at":"2026-06-06T17:31:45.957Z","repository":{"id":57420362,"uuid":"437939780","full_name":"justmars/django-highlights","owner":"justmars","description":"Custom javascript in selection of text as Highlight, subsequently saved as generic model via htmx.","archived":false,"fork":false,"pushed_at":"2023-05-16T16:47:01.000Z","size":230,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T13:23:37.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justmars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-13T16:11:18.000Z","updated_at":"2024-11-27T08:58:55.000Z","dependencies_parsed_at":"2025-01-15T12:18:25.270Z","dependency_job_id":"973d0d94-9be3-43b2-b971-d88dd4b62fb7","html_url":"https://github.com/justmars/django-highlights","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"391fd8fa532408f09031308edd7e98946cc2289f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/justmars/django-highlights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmars%2Fdjango-highlights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmars%2Fdjango-highlights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmars%2Fdjango-highlights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmars%2Fdjango-highlights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justmars","download_url":"https://codeload.github.com/justmars/django-highlights/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmars%2Fdjango-highlights/sbom","scorecard":{"id":544308,"data":{"date":"2025-08-11","repo":{"name":"github.com/justmars/django-highlights","commit":"61ece5f01333a7e38e77b9862ce941fc9e7abc16"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/justmars/django-highlights/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/justmars/django-highlights/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/justmars/django-highlights/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/justmars/django-highlights/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/justmars/django-highlights/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/justmars/django-highlights/main.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/main.yml:19","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"41 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-230 / GHSA-248v-346w-9cwc","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: PYSEC-2024-102 / GHSA-5hgc-2vfp-mqvc","Warn: Project is vulnerable to: PYSEC-2024-68 / GHSA-795c-9xpc-xw6g","Warn: Project is vulnerable to: PYSEC-2023-225 / GHSA-7h4p-27mh-hmrw","Warn: Project is vulnerable to: PYSEC-2025-47 / GHSA-7xr5-9hcq-chf9","Warn: Project is vulnerable to: PYSEC-2024-156 / GHSA-8498-2h75-472j","Warn: Project is vulnerable to: PYSEC-2025-37 / GHSA-8j24-cjrq-gr2m","Warn: Project is vulnerable to: PYSEC-2024-58 / GHSA-9jmf-237g-qf46","Warn: Project is vulnerable to: PYSEC-2024-59 / GHSA-f6f8-9mx6-9mx2","Warn: Project is vulnerable to: PYSEC-2023-226 / GHSA-h8gc-pgj2-vjm3","Warn: Project is vulnerable to: PYSEC-2023-100 / GHSA-jh3w-4vvf-mjgr","Warn: Project is vulnerable to: PYSEC-2024-67 / GHSA-jh75-99hh-qvx9","Warn: Project is vulnerable to: PYSEC-2024-157 / GHSA-m9g8-fxxm-xg86","Warn: Project is vulnerable to: PYSEC-2025-13 / GHSA-p3fp-8748-vqfq","Warn: Project is vulnerable to: PYSEC-2024-70 / GHSA-pv4p-cwwg-4rph","Warn: Project is vulnerable to: PYSEC-2025-1 / GHSA-qcgg-j2x8-h9g8","Warn: Project is vulnerable to: PYSEC-2024-56 / GHSA-qg2p-9jwr-mmqf","Warn: Project is vulnerable to: PYSEC-2023-222 / GHSA-qmf9-6jqf-j8fq","Warn: Project is vulnerable to: PYSEC-2024-69 / GHSA-r836-hh6v-rg5g","Warn: Project is vulnerable to: GHSA-rrqc-c2jx-6jgv","Warn: Project is vulnerable to: PYSEC-2024-47 / GHSA-vm8q-m57g-pff3","Warn: Project is vulnerable to: PYSEC-2024-57 / GHSA-x7q2-wr7g-xqmf","Warn: Project is vulnerable to: PYSEC-2024-28 / GHSA-xxj9-f6rv-m3x4","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: GHSA-2m57-hf25-phgg","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T09:05:09.160Z","repository_id":57420362,"created_at":"2025-08-20T09:05:09.160Z","updated_at":"2025-08-20T09:05:09.160Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33993195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T05:38:57.212Z","updated_at":"2026-06-06T17:31:45.941Z","avatar_url":"https://github.com/justmars.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-highlights\n\nAdd a generic relation `Highlight` to arbitrary models.\n\n1. Selecting the highlight is done with custom javascript.\n2. Saving the highlightted snippet (without page refresh) is done with `htmx` with a dash of `hyperscript` for dealing with the return trigger.\n\n## Setup\n\n### Install\n\n```zsh\n.venv\u003e poetry add django-highlights # pip3 install django-highlights\n```\n\n### Add app to project settings\n\n```python\n# in project_folder/settings.py\nINSTALLED_APPS = [..., \"highlights\"]\n```\n\n### Add highlight model to database\n\n```zsh\n.venv\u003e python manage.py migrate\n```\n\n## Configuration\n\n### Initialize model\n\nEnsure model, e.g. `Sentinel`, with:\n\n1. a _unique_ SlugField named `slug` - this will be used for creating the `highlight url`\n2. a TextField, e.g. `content`/`description` - this is the field that will be _highlightable_\n\n### Add mixin\n\nMake the initialized model inherit from the `AbstractHighlightable` abstract base model :\n\n```python\nfrom django_extensions.db.models import TitleSlugDescriptionModel\nfrom highlights.models import AbstractHighlightable  # import\n\n\nclass Sentinel(TitleSlugDescriptionModel, AbstractHighlightable):  # add\n    pass\n```\n\nEach `Sentinel` instance, i.e. pk=1, pk=2, etc., will now have generic relations to a `Highlight` model and have access to a pre-named, `slug`-based `highlight_url`. The `Sentinel` class will now have a `@highlight_path` property to be used in `urlpatterns` so that each instances `highlight_url` is recognized by the project.\n\n### Setup url\n\n```python\n# sentinels/urls.py\nfrom .apps import (\n    SentinelsConfig,\n)  # already built when you previously created `sentinels` via python manage.py startapp sentinels\nfrom .models import Sentinel\n\napp_name = SentinelsConfig.name  # new\nurlpatterns = [Sentinel.highlight_path, ...]  # new\n```\n\n### Use article id with highighter and notice\n\n```jinja\n\u003c!-- sentinels/templates/sentinel_detail.html --\u003e\n\n\u003c!-- Note the `object` as the context_object_name --\u003e\n\n\u003cmain class=\"container\"\u003e\n    \u003ch1\u003eTitle: {{ object.title }}\u003c/h1\u003e\n\n    \u003c!-- 1. article id will be the scope monitored for user highlights --\u003e\n    \u003carticle id=\"highlightable\"\u003e\n        {{object.description}}\n    \u003c/article\u003e\n\u003c/main\u003e\n\n{% if user.is_authenticated %}\n    \u003c!-- 2. a toast box will be triggered on a successful highlight --\u003e\n    \u003cdiv class=\"position-fixed top-0 end-0 p-3\" style=\"z-index: 11\"\u003e\n        \u003cdiv id=\"highlight-notice\" class=\"toast hide\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"\u003e\n            \u003cdiv class=\"toast-body\"\u003e\n                \u003cspan class=\"me-auto\"\u003eHighlight added!\u003c/span\u003e\n                \u003cbutton type=\"button\" class=\"btn-close float-end\" data-bs-dismiss=\"toast\" aria-label=\"Close\"\u003e\u003c/button\u003e\n            \u003c/div\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n\n    \u003c!-- 3. the footer is unhidden when text within the scope is selected, and will contain a button to highlight --\u003e\n    {% load highlighter %}\n    {% highlight_btn_show url=object.highlight_url %}\n{% endif %}\n```\n\n## Flow\n\n1. The `\u003carticle\u003e` tag will contain the `scope` or the highlightable text field.\n2. The `\u003cfooter\u003e` will contain the `url` or the submission of highlights to the server.\n3. The specific DOM nodes have event listeners found in `textSelector.js`.\n4. Any text selection inside the scoped `\u003carticle\u003e` will reflect in the `\u003cfooter\u003e`'s hidden `\u003cinput\u003e`.\n5. When highlight `maker` is ready with text selection, click on footer `\u003cbutton\u003e` submits highlight stored in `\u003cinput\u003e`.\n6. The submission is done through `htmx`'s `hx-post` without refreshing or swapping content, i.e. a POST request is sent to the `save_highlight` view c/o the passed `highlight_url`.\n7. The request adds a new `Highlight` (from an authenticated highlight `maker`) to the highlightable model instance, e.g. Sentinel pk=2.\n8. The successful POST request sends a header trigger to the client to alert the `maker`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustmars%2Fdjango-highlights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustmars%2Fdjango-highlights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustmars%2Fdjango-highlights/lists"}