experimenting with breaking _ into three separate files with a scipt

This commit is contained in:
notnull 2019-01-28 05:26:25 -08:00
parent 22ec588af2
commit f7cfcae545
6 changed files with 320 additions and 3 deletions

View File

@ -1,11 +1,53 @@
(open bullets with TAB)
* proto
I decided that I kind of hate the idea of breaking this up into three files, so I'm currently looking to see if it's possible to export subjections of a single file, e.g.
https://emacs.stackexchange.com/questions/40870/under-org-mode-save-section-of-file-to-another-file
Or, maybe it makes more sense to open the three files in three separate buffers....
* proto
** intro
The purpose of proto is to document a workflow for projex, etc.
The purpose of proto is to document a process for projex, etc.
The first step is emacs / pandoc / git.
The next step is that I would like to have a tsr/nn base that has one doc that has all of our projects with links to their docs that take the structure below...
After that I would like to articulate / implement a file directory structure standard for all of these projects.
** TODOS
*** TODO decide on / create a tsr/nn base
this would basically be a single .org file that has all projex (including prok!) on it with a kind of overview of where it's at.
I am indifferent to where this is, for now thinking probably just /root/todo.org
Here's an example of hte kinds of projects I think should be in it:
**** projects https://irc.anarchyplanet.org/git/explore/repos
***** server backup
<link to the directory or something>
<link to the todo file>
etc.
***** projex
***** prok
***** proto
***** tech tuesdays
***** ircbang
***** etc.
*** TODO establish a standard directory structure for projex repos
I propose the folder structure we've started with org/ , /html , etc. And then the three following files:
**** README
- the context (e.g. audience, who has access to the project, whether the repo is public/private, etc)
- how to get new people involved in the project
(we will need a overarching overview that explains the process which I will get to when I can)
**** TODOs
the todo contains things that actually need to be done (i.e. action items, these can be linked to pull requests or issues, and eventually we can probably even set up hooks etc.)
**** notes
I want to keep track of these but I don't necessarily want them cluttering up the repos. I use them for, e.g. walking kittens through tutorials, asking you questions and getting answers, etc. I have been putting a notes directory in gitignore... for now I'm going to probably leave this in TODOs because I'm not sure what the answer is yet.
*** TODO document an onboarding sequence for AP projex ppl
- something like:
- SSH
@ -13,5 +55,38 @@ The first step is emacs / pandoc / git.
- git
- hidden services
- pandoc
- like etc. etc.
** notes
Another step is coming up with an admin/dev process (i.e. tsr and notnull)
I thought that using README.org would be a good way to have the one intro document but I'd say the main function of README.md is to give outsiders an overview of the project, so it doesn't make sense for dev todos and notes.
One option might be to have a centralized org doc that links to the directories for our other projects, with TODOs.
Ideally, each directory will have a file (thinking todo.org) that has the todos. then the central document will link to each project directory's todos (also, I will show you about how to use agendamode).
and then each of these will have a repo and then a directory with the file struture outlined in projex (directories = org md html etc etc) and then the files README, todo, and notes can be in any or all of these.
that way when I'm like 'what is tsr working on that I need to know about?' It can all be in one place but also in all o fthe places (repo on gogs, personal directories, etc) I see, you want links to repos and files.
I am not opposed to autoamating the generation of that process by hitting an api that gogs has for that expore place, for example. (or building an API)
For me it's like figuring out prios atm. Need to restore my files and have to test cryptsetup more and procastinate very well.
what happened to your files? also, re: cryptsetup, that is something for serge backup or something you're doing independently? or both?
The debian installer overwrote the partition table and i need to find the partition start or if it got overwritten bruteforce it which somehow seems unlikely to work.
:( sux!
Still interesting to get familiar with. just need to start and write scripts or test hash..something - backup on serge is a good opportunity.
perfect! also I was thinking about maybe eventually setting up an encrypted partition here. but yeah, that is cool! let me try to create that loop device atached to a container.
sounds good to me! I will be working on this organizing I've mentioned here, and also if you work on cryptsetup on wemux I'll check in :) k
also re: gogs explore/repo thx for pointing that out... solike, if ircbang wants a list of todos that people could help with, I would want it to take the form of what we did with the irc-how-to for example, where now it is implemented in text, git, etherpad, etc.
The next step is establishing standards for the process. I propose a directory structure similar to the one we've been building that contains the following files:
[[file+emacs:/home/notnull/projex/org.todo.org][projex todos]]

75
org/TODOS.org Normal file
View File

@ -0,0 +1,75 @@
:PROPERTIES:
:EXPORT_FILE_NAME: TODOS
:END:
* TODO decide on / create a tsr/nn base
this would basically be a single .org file that has all projex (including prok!) on it with a kind of overview of where it's at.
I am indifferent to where this is, for now thinking probably just /root/todo.org
Here's an example of hte kinds of projects I think should be in it:
** projects [[https://irc.anarchyplanet.org/git/explore/repos]]
*** server backup
<link to the directory or something>
<link to the todo file>
etc.
*** projex
*** prok
*** proto
*** tech tuesdays
*** ircbang
*** etc.
* TODO establish a standard directory structure for projex repos
I propose the folder structure we've started with org/ , /html , etc. And then the three following files:
** README
- the context (e.g. audience, who has access to the project, whether the repo is public/private, etc)
- how to get new people involved in the project
(we will need a overarching overview that explains the process which I will get to when I can)
** TODOs
the todo contains things that actually need to be done (i.e. action items, these can be linked to pull requests or issues, and eventually we can probably even set up hooks etc.)
** notes
I want to keep track of these but I don't necessarily want them cluttering up the repos. I use them for, e.g. walking kittens through tutorials, asking you questions and getting answers, etc. I have been putting a notes directory in gitignore... for now I'm going to probably leave this in TODOs because I'm not sure what the answer is yet.
* TODO document an onboarding sequence for AP projex ppl
- something like:
- SSH
- tmux/wemux
- git
- hidden services
- pandoc
* notes
Another step is coming up with an admin/dev process (i.e. tsr and notnull)
I thought that using README.org would be a good way to have the one intro document but I'd say the main function of README.md is to give outsiders an overview of the project, so it doesn't make sense for dev todos and notes.
One option might be to have a centralized org doc that links to the directories for our other projects, with TODOs.
Ideally, each directory will have a file (thinking todo.org) that has the todos. then the central document will link to each project directory's todos (also, I will show you about how to use agendamode).
and then each of these will have a repo and then a directory with the file struture outlined in projex (directories = org md html etc etc) and then the files README, todo, and notes can be in any or all of these.
that way when I'm like 'what is tsr working on that I need to know about?' It can all be in one place but also in all o fthe places (repo on gogs, personal directories, etc) I see, you want links to repos and files.
I am not opposed to autoamating the generation of that process by hitting an api that gogs has for that expore place, for example. (or building an API)
For me it's like figuring out prios atm. Need to restore my files and have to test cryptsetup more and procastinate very well.
what happened to your files? also, re: cryptsetup, that is something for serge backup or something you're doing independently? or both?
The debian installer overwrote the partition table and i need to find the partition start or if it got overwritten bruteforce it which somehow seems unlikely to work.
:( sux!
Still interesting to get familiar with. just need to start and write scripts or test hash..something - backup on serge is a good opportunity.
perfect! also I was thinking about maybe eventually setting up an encrypted partition here. but yeah, that is cool! let me try to create that loop device atached to a container.
sounds good to me! I will be working on this organizing I've mentioned here, and also if you work on cryptsetup on wemux I'll check in :) k
also re: gogs explore/repo thx for pointing that out... solike, if ircbang wants a list of todos that people could help with, I would want it to take the form of what we did with the irc-how-to for example, where now it is implemented in text, git, etherpad, etc.
The next step is establishing standards for the process. I propose a directory structure similar to the one we've been building that contains the following files:
[[file+emacs:/home/notnull/projex/org.todo.org][projex todos]]

107
org/_proto.org Normal file
View File

@ -0,0 +1,107 @@
I want all of my projects to speak for themselves, regardless of what others say!
* proto
** intro
The purpose of proto is to document a process for projex, etc.
The first step is emacs / pandoc / git. (we've basically solved this)
The next step is that I would like to have a tsr/nn base that has one doc that has all of our projects with links to their docs that take the structure below...
After that I would like to articulate / implement a file directory structure standard for all of these projects.
** TODOS
*** TODO decide on / create a tsr/nn base
It's kind of looking like /root/serge/docs/serverl337.org is becoming that base? nn is trying to adapt to tsr's process too :)
this would basically be a single .org file that has all projex (including prok!) on it with a kind of overview of where it's at.
see [[tsr/nn base]]
Here's an example of the kinds of projects I think should be in it:
**** projects
***** server backup
<link to the directory or something>
<link to the todo file>
etc.
***** projex
***** prok
***** proto
***** tech tuesdays
***** ircbang
***** etc.
e.g., things here: https://irc.anarchyplanet.org/git/explore/repos
*** TODO establish a standard directory structure for projex repos
see [[export_headlines]]
I propose the folder structure we've started with org/ , /html , etc. And then either a single document with three sections or the three following files:
**** README
- the goal / purpose
- the context (e.g. audience, who has access to the project, whether the repo is public/private, etc)
- how to get new people involved in the project
(we will need a overarching overview that explains the process which I will get to when I can)
**** TODOs
the todo contains things that actually need to be done (i.e. action items, these can be linked to pull requests or issues, and eventually we can probably even set up hooks etc.)
the thing that would be REALLY NICE about having these be separate files called todo.org is that it would make it easy to add them to agenda mode.
**** notes
I want to keep track of these but I don't necessarily want them cluttering up the repos. I use them for, e.g. walking kittens through tutorials, asking you questions and getting answers, etc. I have been putting a notes directory in .gitignore for now I'm going to probably leave this in TODOs because I'm not sure what the answer is yet.
*** TODO document an onboarding sequence for AP projex ppl
- something like:
- SSH
- tmux/wemux
- git
- hidden services
- pandoc
** notes
*** function for exporting headlines as separate documents
#+NAME: export_headlines
I decided that I kind of hate the idea of breaking this up into three files, so I'm currently looking to see if it's possible to export subjections of a single file, e.g.
https://emacs.stackexchange.com/questions/40870/under-org-mode-save-section-of-file-to-another-file
This works well but (1) I don't like how it adds the :PROPERTIES: drawer automatically to the headline, (2) It would need to have an option for controlling the depth, (3) it currently writes pdfs using latex, and the syntax would have to be changed a bit in order to make it work for exporting text. etc.
Anyway, this is peak autismo :P
Ok so it looks like it probably exports the :PROPERTIES: drawer because that's how it gets linked to the file when it gets exported...
But... if I didn't really care about that I'm sure there'd be another way to fix it.
Or, maybe it makes more sense to open the three files in three separate buffers....
I like the idea to merge stuff it is on the same topic.
wow, this function actually works REALLY well!
which? also what was that cool undo tree earler?
it's a package called undo-tree :)
#+NAME: tsr/nn base
Another step is coming up with an admin/dev process (i.e. tsr and notnull)
I thought that using README.org would be a good way to have the one intro document but I'd say the main function of README.md is to give outsiders an overview of the project, so it doesn't make sense for dev todos and notes.
One option might be to have a centralized org doc that links to the directories for our other projects, with TODOs.
Ideally, each directory will have a file (thinking todo.org) that has the todos. then the central document will link to each project directory's todos (also, I will show you about how to use agendamode).
and then each of these will have a repo and then a directory with the file struture outlined in projex (directories = org md html etc etc) and then the files README, todo, and notes can be in any or all of these.
that way when I'm like 'what is tsr working on that I need to know about?' It can all be in one place but also in all o fthe places (repo on gogs, personal directories, etc) I see, you want links to repos and files.
I am not opposed to autoamating the generation of that process by hitting an api that gogs has for that expore place, for example. (or building an API)
For me it's like figuring out prios atm. Need to restore my files and have to test cryptsetup more and procastinate very well.
what happened to your files? also, re: cryptsetup, that is something for serge backup or something you're doing independently? or both?
The debian installer overwrote the partition table and i need to find the partition start or if it got overwritten bruteforce it which somehow seems unlikely to work.
:( sux!
Still interesting to get familiar with. just need to start and write scripts or test hash..something - backup on serge is a good opportunity.
perfect! also I was thinking about maybe eventually setting up an encrypted partition here. but yeah, that is cool! let me try to create that loop device atached to a container.
sounds good to me! I will be working on this organizing I've mentioned here, and also if you work on cryptsetup on wemux I'll check in :) k
also re: gogs explore/repo thx for pointing that out... solike, if ircbang wants a list of todos that people could help with, I would want it to take the form of what we did with the irc-how-to for example, where now it is implemented in text, git, etherpad, etc.

10
org/intro.org Normal file
View File

@ -0,0 +1,10 @@
:PROPERTIES:
:EXPORT_FILE_NAME: intro
:END:
The purpose of proto is to document a process for projex, etc.
The first step is emacs / pandoc / git.
The next step is that I would like to have a tsr/nn base that has one doc that has all of our projects with links to their docs that take the structure below...
After that I would like to articulate / implement a file directory structure standard for all of these projects.

20
org/notes.org Normal file
View File

@ -0,0 +1,20 @@
:PROPERTIES:
:EXPORT_FILE_NAME: notes
:END:
* function for exporting headlines as separate documents
I decided that I kind of hate the idea of breaking this up into three files, so I'm currently looking to see if it's possible to export subjections of a single file, e.g.
[[https://emacs.stackexchange.com/questions/40870/under-org-mode-save-section-of-file-to-another-file]]
This works well but (1) I don't like how it adds the :PROPERTIES: drawer automatically to the headline, (2) It would need to have an option for controlling the depth, (3) it currently writes pdfs using latex, and the syntax would have to be changed a bit in order to make it work for exporting text. etc.
Anyway, this is peak autismo :P
Or, maybe it makes more sense to open the three files in three separate buffers....
I like the idea to merge stuff it is on the same topic.
wow, this function actually works REALLY well!
which? also what was that cool undo tree earler?
it's a package called undo-tree :)

View File

@ -0,0 +1,30 @@
;; export headlines to separate files
;; http://emacs.stackexchange.com/questions/2259/how-to-export-top-level-headings-of-org-mode-buffer-to-separate-files
(defun org-export-headlines-to-txt ()
"Export all subtrees that are *not* tagged with :noexport: to
separate files.
Subtrees that do not have the :EXPORT_FILE_NAME: property set
are exported to a filename derived from the headline text."
(interactive)
(save-buffer)
(let ((modifiedp (buffer-modified-p)))
(save-excursion
(goto-char (point-min))
(goto-char (re-search-forward "^*"))
(set-mark (line-beginning-position))
(goto-char (point-max))
(org-map-entries
(lambda ()
(let ((export-file (org-entry-get (point) "EXPORT_FILE_NAME")))
;; I'm assuming 'export-file' is an on-the-fly var;
;; org-entry-get is part of the property API and finds the heading that has that property
(unless export-file
(org-set-property
"EXPORT_FILE_NAME"
(replace-regexp-in-string " " "_" (nth 4 (org-heading-components)))))
(deactivate-mark)
(org-org-export-to-org nil t) ;; will have to learn a tiny bit of lisp
(unless export-file (org-delete-property "EXPORT_FILE_NAME"))
(set-buffer-modified-p modifiedp)))
"-noexport" 'region-start-level))))