Compare commits
2 Commits
f890e941bb
...
5244f761d0
Author | SHA1 | Date |
---|---|---|
Ryan Rix | 5244f761d0 | |
Ryan Rix | d0b050a697 |
|
@ -1,7 +1,12 @@
|
|||
;; [[file:arroyo-emacs.org::*Arroyo Emacs =init.el= generator][Arroyo Emacs =init.el= generator:1]]
|
||||
(defcustom arroyo-emacs-init-location (expand-file-name "~/arroyo-nix/files/init.el")
|
||||
"Where `arroyo-emacs-generate-init' writes the amalgamated init file."
|
||||
:group 'arroyo
|
||||
:type 'string)
|
||||
|
||||
(defun arroyo-emacs-generate-init ()
|
||||
(interactive)
|
||||
(arroyo-generate-imports "emacs" nil arroyo-emacs-init-location)
|
||||
(arroyo-generate-imports "emacs" nil arroyo-emacs-init-location nil)
|
||||
(find-file arroyo-emacs-init-location))
|
||||
;; Arroyo Emacs =init.el= generator:1 ends here
|
||||
|
||||
|
|
|
@ -31,9 +31,14 @@ Users of the Arroyo Home Manager generator will have access to features availabl
|
|||
#+ARROYO_MODULE_WANTS: arcology-django/interfaces.org
|
||||
|
||||
#+begin_src emacs-lisp :results none -r
|
||||
(defcustom arroyo-emacs-init-location (expand-file-name "~/arroyo-nix/files/init.el")
|
||||
"Where `arroyo-emacs-generate-init' writes the amalgamated init file."
|
||||
:group 'arroyo
|
||||
:type 'string)
|
||||
|
||||
(defun arroyo-emacs-generate-init ()
|
||||
(interactive)
|
||||
(arroyo-generate-imports "emacs" nil arroyo-emacs-init-location)
|
||||
(arroyo-generate-imports "emacs" nil arroyo-emacs-init-location nil)
|
||||
(find-file arroyo-emacs-init-location))
|
||||
#+end_src
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ in pkgs.mkShell {
|
|||
pkgs ? import <nixpkgs> {},
|
||||
lib ? pkgs.lib,
|
||||
|
||||
python3,
|
||||
python3 ? pkgs.python3,
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonPackage rec {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;; [[file:arroyo-nixos.org::*Calling in to the Arcology to generate \[\[id:cce/my_nixos_configuration\]\[My NixOS Configuration\]\]][Calling in to the Arcology to generate [[id:cce/my_nixos_configuration][My NixOS Configuration]]:1]]
|
||||
(defun arroyo-nixos-imports (&optional role)
|
||||
(arroyo-generate-imports "nixos" role))
|
||||
(arroyo-generate-imports "nixos" role nil t))
|
||||
;; Calling in to the Arcology to generate [[id:cce/my_nixos_configuration][My NixOS Configuration]]:1 ends here
|
||||
|
||||
;; [[file:arroyo-nixos.org::*Flooding the Arroyo tangles and deploys all sub-systems][Flooding the Arroyo tangles and deploys all sub-systems:1]]
|
||||
|
|
|
@ -19,7 +19,7 @@ I'll move this code here someday, for now we call it with a nix run. good luck m
|
|||
|
||||
#+begin_src emacs-lisp
|
||||
(defun arroyo-nixos-imports (&optional role)
|
||||
(arroyo-generate-imports "nixos" role))
|
||||
(arroyo-generate-imports "nixos" role nil t))
|
||||
#+end_src
|
||||
|
||||
* Arroyo NixOS manages systems with [[id:cce/morph][Morph]]:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
pkgs ? import <nixpkgs> {},
|
||||
lib ? pkgs.lib,
|
||||
|
||||
python3,
|
||||
python3 ? pkgs.python3,
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonPackage rec {
|
||||
|
|
12
flake.lock
12
flake.lock
|
@ -5,11 +5,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -20,11 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1698553279,
|
||||
"narHash": "sha256-T/9P8yBSLcqo/v+FTOBK+0rjzjPMctVymZydbvR/Fak=",
|
||||
"lastModified": 1707877513,
|
||||
"narHash": "sha256-sp0w2apswd3wv0sAEF7StOGHkns3XUQaO5erhWFZWXk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "90e85bc7c1a6fc0760a94ace129d3a1c61c3d035",
|
||||
"rev": "89653a03e0915e4a872788d10680e7eec92f8600",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:1]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:1]]
|
||||
use anyhow::Result;
|
||||
use regex;
|
||||
use std::borrow::Cow;
|
||||
|
@ -11,9 +11,9 @@ use orgize::{elements, Element, Org};
|
|||
|
||||
use crate::export_html::ArroyoHtmlHandler;
|
||||
use crate::export_html::ExportOptions;
|
||||
// CANCELLED First Pass:1 ends here
|
||||
// First Pass:1 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:2]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:2]]
|
||||
pub struct ArroyoAtomHandler<E: From<Error>, H: HtmlHandler<E>> {
|
||||
pub options: ExportOptions,
|
||||
pub inner: ArroyoHtmlHandler<E, H>,
|
||||
|
@ -61,9 +61,9 @@ impl<E: From<Error>, H: HtmlHandler<E>> Default for ArroyoAtomHandler<E, H> {
|
|||
}
|
||||
}
|
||||
}
|
||||
// CANCELLED First Pass:2 ends here
|
||||
// First Pass:2 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:3]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:3]]
|
||||
pub fn atomize_file(path: String, options: ExportOptions) -> Result<String> {
|
||||
let syntect_handler = SyntectHtmlHandler::new(DefaultHtmlHandler);
|
||||
let html_handler = ArroyoHtmlHandler::new(options.clone(), syntect_handler);
|
||||
|
@ -90,74 +90,74 @@ pub fn atomize_file(path: String, options: ExportOptions) -> Result<String> {
|
|||
org_tree.write_html_custom(&mut vec, &mut handler)?;
|
||||
Ok(String::from_utf8(vec)?)
|
||||
}
|
||||
// CANCELLED First Pass:3 ends here
|
||||
// First Pass:3 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:4]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:4]]
|
||||
impl<E: From<Error>, H: HtmlHandler<E>> HtmlHandler<E> for ArroyoAtomHandler<E, H> {
|
||||
fn start<W: Write>(&mut self, mut w: W, element: &Element) -> Result<(), E> {
|
||||
(match element {
|
||||
// CANCELLED First Pass:4 ends here
|
||||
// First Pass:4 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:5]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:5]]
|
||||
Element::Document { .. } => self.start_document(w, element),
|
||||
// CANCELLED First Pass:5 ends here
|
||||
// First Pass:5 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:6]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:6]]
|
||||
Element::Keyword(kw) => self.start_keyword(w, kw),
|
||||
// CANCELLED First Pass:6 ends here
|
||||
// First Pass:6 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:7]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:7]]
|
||||
Element::Title(title) => self.start_title(w, title),
|
||||
// CANCELLED First Pass:7 ends here
|
||||
// First Pass:7 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:8]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:8]]
|
||||
Element::Drawer(drawer) => {
|
||||
self.in_drawer = drawer.name == "PROPERTIES" && self.feed_page_id.eq("");
|
||||
self.start_rest(w, element)
|
||||
}
|
||||
Element::Text { value } => self.start_text(w, value),
|
||||
// CANCELLED First Pass:8 ends here
|
||||
// First Pass:8 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:9]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:9]]
|
||||
_t => self.start_rest(w, element),
|
||||
})
|
||||
.unwrap(); // if we can't parse something, just fucken panic.
|
||||
// CANCELLED First Pass:9 ends here
|
||||
// First Pass:9 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:10]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:10]]
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn end<W: Write>(&mut self, mut w: W, element: &Element) -> Result<(), E> {
|
||||
(match element {
|
||||
// CANCELLED First Pass:10 ends here
|
||||
// First Pass:10 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:11]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:11]]
|
||||
// Element::Title(_title) => {}
|
||||
Element::Document { .. } => self.end_document(w, element),
|
||||
// CANCELLED First Pass:11 ends here
|
||||
// First Pass:11 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:12]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:12]]
|
||||
Element::Drawer(drawer) => {
|
||||
self.in_drawer = false;
|
||||
self.end_rest(w, element)
|
||||
}
|
||||
// CANCELLED First Pass:12 ends here
|
||||
// First Pass:12 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:13]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:13]]
|
||||
_ => self.end_rest(w, element),
|
||||
})
|
||||
.ok();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
// CANCELLED First Pass:13 ends here
|
||||
// First Pass:13 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:14]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:14]]
|
||||
impl<E: From<Error>, H: HtmlHandler<E>> ArroyoAtomHandler<E, H> {
|
||||
// CANCELLED First Pass:14 ends here
|
||||
// First Pass:14 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:15]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:15]]
|
||||
fn start_document<W: Write>(&mut self, mut w: W, _document: &elements::Element) -> Result<()> {
|
||||
Ok(write!(
|
||||
w,
|
||||
|
@ -178,9 +178,9 @@ impl<E: From<Error>, H: HtmlHandler<E>> ArroyoAtomHandler<E, H> {
|
|||
)?;
|
||||
Ok(())
|
||||
}
|
||||
// CANCELLED First Pass:15 ends here
|
||||
// First Pass:15 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:16]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:16]]
|
||||
fn start_title<W: Write>(&mut self, mut w: W, title: &elements::Title) -> Result<()> {
|
||||
let ignore_tags = vec![
|
||||
String::from("noexport"),
|
||||
|
@ -254,9 +254,9 @@ impl<E: From<Error>, H: HtmlHandler<E>> ArroyoAtomHandler<E, H> {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
// CANCELLED First Pass:16 ends here
|
||||
// First Pass:16 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:17]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:17]]
|
||||
fn start_keyword<W: Write>(&mut self, mut w: W, kw: &elements::Keyword) -> Result<()> {
|
||||
// dbg!(kw);
|
||||
match kw.key.as_ref() {
|
||||
|
@ -292,9 +292,9 @@ impl<E: From<Error>, H: HtmlHandler<E>> ArroyoAtomHandler<E, H> {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
// CANCELLED First Pass:17 ends here
|
||||
// First Pass:17 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*CANCELLED First Pass][CANCELLED First Pass:18]]
|
||||
// [[file:../arroyo-native-parser.org::*First Pass][First Pass:18]]
|
||||
fn start_text<W: Write>(&mut self, mut w: W, text: &Cow<str>) -> Result<()> {
|
||||
if self.in_drawer == true {
|
||||
let (_, prop_drawer): (_, orgize::elements::PropertiesMap) =
|
||||
|
@ -346,7 +346,7 @@ impl<E: From<Error>, H: HtmlHandler<E>> ArroyoAtomHandler<E, H> {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
// CANCELLED First Pass:18 ends here
|
||||
// First Pass:18 ends here
|
||||
|
||||
// [[file:../arroyo-native-parser.org::*Strip Links from Strings][Strip Links from Strings:1]]
|
||||
fn strip_links_from_str(in_str: &str) -> Result<String> {
|
||||
|
|
Loading…
Reference in New Issue