You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Lucien Cartier-Tilet ea91cc015f
Fix wrong regex
1 year ago
CONTRIBUTING.org Change some function names, add README, LICENSE and CONTRIBUTING 1 year ago
LICENSE.md Change some function names, add README, LICENSE and CONTRIBUTING 1 year ago
README.org Change some function names, add README, LICENSE and CONTRIBUTING 1 year ago
org-unique-id.el Fix wrong regex 1 year ago

README.org

org-unique-id

Introduction

org-unique-id is a utility package for org users that are tired dealing with random org IDs for their headers that change on each org to HTML export (and other kinds of exports). This package creates meaningful custom IDs for org headers that won’t change unless the user modifies them manually.

Table of Contents   TOC_2_gh

Installation

This package can be installed like any other simple package. Your first option is to download org-unique-id or clone this package in your load-path and add the following to your configuration:

  (require 'org-unique-id)
  (add-hook 'org-mode-hook
            (lambda ()
              (add-hook 'before-save-hook
                        (lambda ()
                          (when (and (eq major-mode       'org-mode)
                                     (eq buffer-read-only nil))
                            (org-unique-id))))))

You can also use a package manager such as Quelpa or Straight in order to load automatically your package. In my case, I prefer the latter with its use-package integration:

  (use-package org-unique-id
    :require t
    :after org
    :straight (org-unique-id :type git
                             :host github
                             :repo "Phundrak/org-unique-id")
    :init
    (add-hook 'org-mode-hook
       (lambda ()
         (add-hook 'before-save-hook
                   (lambda ()
                     (when (and (eq major-mode       'org-mode)
                                (eq buffer-read-only nil))
                       (org-unique-id)))))))

I also add :build t to my straight recipe to ensure my package is compiled.

If you know how to handle this with a pure Straight recipe, or with a Quelpa recipe, don’t hesitate to submit a PR to add it to this README!

Also, DAMN that’s one hell of a hook, if you know anything simpler than this, please submit it!

License

org-unique-id is available under the GNU GPL-3.0 license. You can find the full text in LICENSE.md.