├── .gitignore ├── LICENSE ├── README.md ├── README.org ├── arabicview ├── assets ├── head.html ├── js │ └── org-info.js ├── postamable.html ├── preamble.html └── style │ ├── comments.css │ ├── gh-fork-ribbon.css │ ├── gh-fork-ribbon.ie.css │ ├── ibm.svg │ ├── main.css │ ├── reset.css │ ├── toc.css │ └── tufte.css ├── content ├── formats.el ├── id.el └── tadwin.el /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled 2 | *.elc 3 | 4 | # Packaging 5 | .cask 6 | 7 | # Backup files 8 | *~ 9 | 10 | # Undo-tree save-files 11 | *.~undo-tree 12 | /static/ 13 | /public/ 14 | /luggages/ 15 | /pic/ 16 | /assets.old/ 17 | /archived/ 18 | /.packages/ 19 | /sigal.conf.py 20 | /build.sh 21 | /publish.sh 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | - [2025-04-19 Sat 14:12] The code here is **EXTREME MESS**. It is not a software 2 | that’s supposed to be used by others (yet). Feel free to ask me about 3 | anything, email address can be found on my profile or web page. 4 | 5 | > Please **do note** that this software is not even a pre-alpha, it’s just my 6 | > personal script. It might not work for you but it will surely help inspiring you 7 | > to build something similar, or it will work for you after some modifications. 8 | 9 | This repository holds code for my publishing system that I use for my [website](https://lr0.fly.dev/), 10 | written in elisp. 11 | 12 | 13 | # Requirements 14 | 15 | - `tadwin.el` uses the `doomscript` executor to access emacs, thus it requires 16 | a [doom emacs](https://github.com/doomemacs/doomemacs) installation, however this can be modified easily to use a 17 | vanilla emacs instead. 18 | - [`org-roam`](https://github.com/org-roam/org-roam) is required by default to link the nodes (website org files) with 19 | each others, however this is can be dismissed too, but you will have to depend 20 | on hierarchical approach to organize your files, which often breaks. 21 | - You can use `org-ids` file to get around this you don’t use org-roam. 22 | 23 | 24 | # Get Started 25 | 26 | Clone the repository and edit [assets/](assets/) to match with your taste. Go through the 27 | file quickly to make sure it’s adjusted to what you wish. Make 28 | sure to redfine `org-id-locations-file` in to your ids file location. 29 | 30 | Afterwards, create `content/` directory, this directory will hold the org files 31 | for your site. Start with creating a `posts` directory under `content` and add 32 | some org files, do not forget to add date. 33 | 34 | Now, under `content` you should instantiate an `index.org` file that will 35 | represent the index of your website. Let’s say you want to make it consists of 36 | the posts directory you just created, then add: 37 | 38 | #+TITLE: My website 39 | #+OPTIONS: toc:nil 40 | 41 | * Recent Posts 42 | #+INCLUDE: sitemap.org::*posts :lines "-26" :only-contents t 43 | 44 | Where 26 is the number of the posts you want to include $\times 5 + 1$ (each post with date 45 | and preview requires 5 lines, and 1 line for org-offset) In this case it 46 | includes the first 5 posts. 47 | 48 | 49 | # Publishing 50 | 51 | Publish the site by executing `tadwin.el`: 52 | 53 | chmod +x tadwin.el 54 | ./tadwin.el 55 | 56 | This assumes that `doomscript` is in your `$PATH`. It will create a `public/` 57 | directory with your static website. You can publish it later using whatever 58 | service you wish, like [fly.io](https://fly.io/) or [GitHub Pages](https://pages.github.com/). 59 | 60 | 61 | # Tip for org-roam 62 | 63 | If you wish sometimes to include the backlinks for a node that you have, you can 64 | add something like: 65 | 66 | #+BEGIN_SRC emacs-lisp :exports results :results value html 67 | (salih/print-back-links) 68 | #+END_SRC 69 | 70 | Which will be evaluated when you export the site to a list of headings for your backlinks. 71 | 72 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | #+DATE: July 6, 2017 2 | #+OPTIONS: toc:nil 3 | 4 | - [2025-04-19 Sat 14:12] The code here is *EXTREME MESS*. It is not a software 5 | that's supposed to be used by others (yet). Feel free to ask me about 6 | anything, email address can be found on my profile or web page. 7 | 8 | #+begin_quote 9 | Please *do note* that this software is not even a pre-alpha, it's just my 10 | personal script. It might not work for you but it will surely help inspiring you 11 | to build something similar, or it will work for you after some modifications. 12 | #+end_quote 13 | 14 | This repository holds code for my publishing system that I use for my [[https://lr0.fly.dev/][website]], 15 | written in elisp. 16 | * Requirements 17 | + ~tadwin.el~ uses the ~doomscript~ executor to access emacs, thus it requires 18 | a [[https://github.com/doomemacs/doomemacs][doom emacs]] installation, however this can be modified easily to use a 19 | vanilla emacs instead. 20 | + [[https://github.com/org-roam/org-roam][~org-roam~]] is required by default to link the nodes (website org files) with 21 | each others, however this is can be dismissed too, but you will have to depend 22 | on hierarchical approach to organize your files, which often breaks. 23 | + You can use ~org-ids~ file to get around this you don't use org-roam. 24 | * Get Started 25 | 26 | Clone the repository and edit [[file:assets/][assets/]] to match with your taste. Go through the 27 | [[file:tadwin.el]] file quickly to make sure it's adjusted to what you wish. Make 28 | sure to redfine ~org-id-locations-file~ in [[file:tadwin.el]] to your ids file location. 29 | 30 | Afterwards, create ~content/~ directory, this directory will hold the org files 31 | for your site. Start with creating a ~posts~ directory under ~content~ and add 32 | some org files, do not forget to add date. 33 | 34 | 35 | Now, under ~content~ you should instantiate an ~index.org~ file that will 36 | represent the index of your website. Let's say you want to make it consists of 37 | the posts directory you just created, then add: 38 | 39 | #+begin_src org 40 | ,#+TITLE: My website 41 | ,#+OPTIONS: toc:nil 42 | 43 | ,* Recent Posts 44 | ,#+INCLUDE: sitemap.org::*posts :lines "-26" :only-contents t 45 | #+end_src 46 | 47 | 48 | Where 26 is the number of the posts you want to include $\times 5 + 1$ (each post with date 49 | and preview requires 5 lines, and 1 line for org-offset) In this case it 50 | includes the first 5 posts. 51 | * Publishing 52 | Publish the site by executing ~tadwin.el~: 53 | #+begin_src sh 54 | chmod +x tadwin.el 55 | ./tadwin.el 56 | #+end_src 57 | This assumes that ~doomscript~ is in your ~$PATH~. It will create a ~public/~ 58 | directory with your static website. You can publish it later using whatever 59 | service you wish, like [[https://fly.io/][fly.io]] or [[https://pages.github.com/][GitHub Pages]]. 60 | * Tip for org-roam 61 | If you wish sometimes to include the backlinks for a node that you have, you can 62 | add something like: 63 | 64 | #+begin_src org 65 | ,#+BEGIN_SRC emacs-lisp :exports results :results value html 66 | (salih/print-back-links) 67 | ,#+END_SRC 68 | #+end_src 69 | 70 | Which will be evaluated when you export the site to a list of headings for your backlinks. 71 | -------------------------------------------------------------------------------- /arabicview: -------------------------------------------------------------------------------- 1 | #+begin_export HTML 2 | 3 | 16 | 17 | #+end_export 18 | -------------------------------------------------------------------------------- /assets/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /assets/js/org-info.js: -------------------------------------------------------------------------------- 1 | function OrgNode(e,h,f,g,d,b,j){var i=this;i.D=e;i.I=b;i.J=-1;i.H=h;i.L=f;i.HH=false; 2 | i.P=d;i.DRT=false;i.ST=OrgNode.SF;i.TOC=j;i.DEPTH=g;i.F=null;i.CH=new Array();i.NAV=""; 3 | i.BS=null;if(null!=i.P){i.P.addChild(this);i.hide();}var a=document.getElementById("text-"+i.I); 4 | if(null==a&&b){var c=b.substring(4);a=document.getElementById("text-"+c);}if(null!=a){i.F=a; 5 | }i.iTF=new Object();i.iTF["#"+i.I]=2;OrgNode.fTI(i.iTF,i.H,1);OrgNode.fTI(i.iTF,i.F,3); 6 | }OrgNode.SF=0;OrgNode.SH=1;OrgNode.SU=2;OrgNode.fTI=function(f,c,e){if(c){var b=c.getElementsByTagName("a"); 7 | if(b){for(var d=0;d2){this.P.show(); 20 | }};OrgNode.prototype.sAC=function(){for(var a=0;a]+>/i,ORGTAGX:/^(.*)(]+>[^<]+<\/span>)+<\/span>/i,TRIMMER:/^(\s*)([^\s].*)(\s*)$/,TOC:null,RUNS:0,H:new Array(50),HI:0,SKIP_H:false,FIXED_TOC:false,C:null,CI:null,CL:null,CO:"50px",OCCUR:"",SCX:"",SC_HLX:new RegExp('()([^<]*?)()',"gi"),Mg:0,MgI:1,MgT:2,Hg:false,Rg:false,RC:"",RC_NULL:"_0",RC_H:"_1",RC_O:"_2",RC_P:"_03",LVM:0,TAB_INDEX:1000,SHO:false,TAGS:{},ST:new Array(),TAGS_INDEX:null,CTO:null,SN_MAP:{},TL:null,HOOKS:{run_hooks:false,onShowSection:[],onReady:[]},setup:function(){var d=this; 32 | if(window.orgInfoHooks){for(var c in orgInfoHooks){d.HOOKS[c]=orgInfoHooks[c];}d.HOOKS.run_hooks=false; 33 | }if(location.search){var e=location.search.substring(1).split("&");for(var c=0;cUp / ':"")+((d.LINK_HOME&&d.LINK_HOME!=document.URL)?'HOME / ':"")+'HELP / '; 41 | d.LOAD_CHECK=window.setTimeout("OrgHtmlManagerLoadCheck()",50);},trim:function(a){var b=this.TRIMMER.exec(a); 42 | return RegExp.$2;},rT:function(a){if(a){while(a.match(this.UNTAGX)){a=a.substr(0,a.indexOf("<"))+a.substr(a.indexOf(">")+1); 43 | }}return a;},rOT:function(a){if(a.match(this.ORGTAGX)){var b=this.ORGTAGX.exec(a); 44 | return b[1];}return a;},init:function(){var m=this;m.RUNS++;m.B=document.getElementById("content"); 45 | if(null==m.B){if(5>m.RUNS){m.LOAD_CHECK=window.setTimeout("OrgHtmlManagerLoadCheck()",m.RUN_INTERVAL); 46 | return;}else{m.B=document.getElementsByTagName("body")[0];}}m.PREA=document.getElementById("preamble"); 47 | m.POST=document.getElementById("postamble");if(null==m.PREA){m.PREA=m.B;}if(null==m.POST){m.POST=m.B; 48 | }if(!m.W){m.W=document.createElement("div");m.W.style.marginBottom="40px";m.W.id="org-info-js-window"; 49 | }var l=document.getElementById("table-of-contents");if(!m.initFromTOC()){if(m.RUNS
 
 
'; 56 | m.C.style.position="relative";m.C.style.marginTop="-"+m.CO;m.C.style.top="-"+m.CO; 57 | m.C.style.left="0px";m.C.style.width="100%";m.C.style.height="40px";m.C.style.overflow="hidden"; 58 | m.C.style.verticalAlign="middle";m.C.style.zIndex="9";m.C.style.border="1px solid #cccccc"; 59 | m.C.id="org-info-js_console-container";m.B.insertBefore(m.C,m.B.firstChild);m.Mg=false; 60 | m.CL=document.getElementById("org-info-js_console-label");m.CI=document.getElementById("org-info-js_console-input"); 61 | document.onkeypress=OrgHtmlManagerKeyEvent;if(m.VIEW==m.INFO_VIEW){m.iV(d);m.ss(d); 62 | window.setTimeout(function(){window.scrollTo(0,0);},100);}else{if(m.VIEW==m.SLIDE_VIEW){m.sV(d); 63 | m.ss(d);}else{var k=m.VIEW;m.pV(d,1);m.R.DRT=true;m.R_STATE=OrgNode.SU;m.tG();if(k>m.PLAIN_VIEW){m.tG(); 64 | }if(k==m.ALL_VIEW){m.tG();}if(f){m.ss(d);}}}if(""!=m.OCCUR){m.CI.value=m.OCCUR;m.RC="o"; 65 | m.eRC();}if(m.STARTUP_MESSAGE){m.warn("This page uses org-info.js. Press '?' for more information.",true); 66 | }m.HOOKS.run_hooks=true;m.runHooks("onReady",this.N);},initFromTOC:function(){var k=this; 67 | if(k.RUNS==1||!k.R){var b=document.getElementById("table-of-contents");if(null!=b){var m=null; 68 | var d=0;for(d;m==null&&d<7;++d){m=b.getElementsByTagName("h"+d)[0];}m.onclick=function(){org_html_manager.fold(0); 69 | };m.style.cursor="pointer";if(k.MOUSE_HINT){m.onmouseover=function(){org_html_manager.hH(0); 70 | };m.onmouseout=function(){org_html_manager.unhH(0);};}if(k.FIXED_TOC){m.setAttribute("onclick","org_html_manager.tG();"); 71 | k.R=new OrgNode(null,k.B.getElementsByTagName("h1")[0],"javascript:org_html_manager.go(0);",0,null); 72 | k.TOC=new OrgNode(b,m,"javascript:org_html_manager.go(0);",d,null);k.N=k.R;}else{k.R=new OrgNode(null,k.B.getElementsByTagName("h1")[0],"javascript:org_html_manager.go(0);",0,null); 73 | if(k.HIDE_TOC){k.TOC=new OrgNode(b,"","javascript:org_html_manager.go(0);",d,null); 74 | k.N=k.R;OrgNode.hE(b);}else{k.TOC=new OrgNode(b,m,"javascript:org_html_manager.go(0);",d,k.R); 75 | k.TOC.J=0;k.N=k.TOC;k.S.push(k.TOC);}}if(k.TOC){k.TOC.F=document.getElementById("text-table-of-contents"); 76 | }}else{return false;}}var j=k.TOC.F.getElementsByTagName("ul")[0];if(!k.ulToOutlines(j)){return false; 77 | }var h=document.getElementById("footnotes");if(h){var a=null;var f=h.childNodes;for(var d=0; 78 | dthis.TOC_DEPTH){a.removeChild(g); 93 | }else{this.cutToc(g,f);}}}}}},mkNodeFromHref:function(g){s=g.href;if(s.match(this.REGEX)){var k=this.REGEX.exec(s); 94 | var c=k[2];var l=document.getElementById(c);if(null==l){return(false);}var a=l.parentNode; 95 | var m=this.S.length;var f=a.className.substr(8);l.onclick=function(){org_html_manager.fold(""+m); 96 | };l.style.cursor="pointer";if(this.MOUSE_HINT){l.onmouseover=function(){org_html_manager.hH(""+m); 97 | };l.onmouseout=function(){org_html_manager.unhH(""+m);};}var o="javascript:org_html_manager.go("+m+")"; 98 | if(f>this.N.DEPTH){this.N=new OrgNode(a,l,o,f,this.N,c,g);}else{if(f==2){this.N=new OrgNode(a,l,o,f,this.R,c,g); 99 | }else{var b=this.N;while(b.DEPTH>f){b=b.P;}this.N=new OrgNode(a,l,o,f,b.P,c,g);}}this.S.push(this.N); 100 | var n=l.getElementsByTagName("span");if(n){for(var e=0;e'+this.LINKS+'toggle view'; 105 | if(d>0){c+='Previous | '; 106 | }else{c+="Previous | ";}if(dNext'; 107 | }else{c+="Next";}c+=''; 108 | if(d>0&&this.S[d].P.P){c+=''+this.S[d].P.H.innerHTML+""; 109 | }else{c+=''+this.S[d].H.innerHTML+""; 110 | }c+=''; 111 | c+=(d+1)+"";this.S[d].BS=document.createElement("div");this.S[d].BS.innerHTML='
'+this.LINKS+'toggle view
'; 112 | if(this.S[d].F){this.S[d].D.insertBefore(this.S[d].BS,this.S[d].H);}else{if(this.S[d].D.hasChildNodes()){this.S[d].D.insertBefore(this.S[d].BS,this.S[d].D.firstChild); 113 | }}if(!this.VIEW_BUTTONS){OrgNode.hE(this.S[d].BS);}this.S[d].NAV=c;if(0'+this.rT(this.rOT(this.S[d].CH[b].H.innerHTML))+""; 116 | }c+="";a.innerHTML=c;if("above"==this.LOCAL_TOC){if(this.S[d].F){this.S[d].F.insertBefore(a,this.S[d].F.firstChild); 117 | }else{this.S[d].D.insertBefore(a,this.S[d].D.getElementsByTagName("h"+this.S[d].DEPTH)[0].nextSibling); 118 | }}else{if(this.S[d].F){this.S[d].F.appendChild(a);}else{this.S[d].D.appendChild(a); 119 | }}}}this.ST.sort();},set:function(eval_key,eval_val){if("VIEW"==eval_key){var pos=eval_val.indexOf("_"); 120 | if(-1!=pos){this.IT=eval_val.substr(pos+1);eval_val=eval_val.substr(0,pos);}var overview=this.PLAIN_VIEW; 121 | var content=this.CONTENT_VIEW;var showall=this.ALL_VIEW;var info=this.INFO_VIEW;var info_title_above=this.INFO_VIEW; 122 | var slide=this.SLIDE_VIEW;eval("this."+eval_key+"="+eval_val+";");}else{if("HELP"==eval_key){eval("this.STARTUP_MESSAGE="+eval_val+";"); 123 | }else{if(eval_val){eval("this."+eval_key+"='"+eval_val+"';");}else{eval("this."+eval_key+"=0;"); 124 | }}}},convertLinks:function(){var f=(this.HIDE_TOC?0:1);var e;var a=this.S.length-1; 125 | var d=document.getElementsByTagName("a");for(e=0;ethis.N.J){d=true; 150 | }if(null==g){d=true;}if(d){for(var a=this.S[f].F.firstChild;null!=a;a=a.nextSibling){if("UL"==a.nodeName){var j=a.getElementsByTagName("li"); 151 | for(var c=1;c0){if(OrgNode.isHidden(b)){OrgNode.uhE(b);if(c<(j.length-1)){k=false; 154 | }if(00){b.go(a-1);}else{b.warn("Already first section.");}},go:function(b){var a=this; 171 | if(a.Rg){a.eR();a.hC();}else{if(a.Mg){a.rW();}}if(a.VIEW==a.SLIDE_VIEW){a.adjustSlide(b); 172 | }a.puH(b,a.N.J);a.ss(b);},puH:function(c,a){var b=this;if(!b.SKIP_H){b.H[b.HI]=new Array(c,a); 173 | b.HI=(b.HI+1)%50;}b.SKIP_H=false;b.CI.value="";},poH:function(c){var a=this;if(c){if(a.H[a.HI]){var b=parseInt(a.H[a.HI][0]); 174 | if(!isNaN(b)||"?/toc/?"==a.H[a.HI][0]){a.ss(a.H[a.HI][0]);a.CI.value="";}else{a.SKIP_H=true; 175 | a.CI.value=a.H[a.HI][0];a.getKey();}a.HI=(a.HI+1)%50;a.HBO=0;}else{if(a.HFO&&history.length){history.forward(); 176 | }else{a.HFO=1;a.warn("History: No where to foreward go from here. Any key and `B' to move to next file in history."); 177 | }}}else{if(a.H[a.HI-1]){a.HI=a.HI==0?49:a.HI-1;var b=parseInt(a.H[a.HI][1]);if(!isNaN(b)||"?/toc/?"==a.H[a.HI][1]){a.ss(a.H[a.HI][1]); 178 | a.CI.value="";}else{a.SKIP_H=true;a.CI.value=a.H[a.HI][1];a.getKey();}a.HFO=0;}else{if(a.HBO&&history.length){history.back(); 179 | }else{a.HBO=1;a.warn("History: No where to back go from here. Any key and `b' to move to previous file in history."); 180 | }}}},warn:function(c,d,b){var a=this;if(null==b){b="";}a.CI.value=b;if(!d){a.CL.style.color="red"; 181 | }a.CL.innerHTML=""+c+"(press any key to proceed)"; 182 | a.sC();window.setTimeout(function(){org_html_manager.CI.value=b;},50);},sR:function(e,b,d,a){var c=this; 183 | if(null==d){d="";}if(null==a){a="";}c.RC=e;c.Rg=true;c.CL.innerHTML=""+b+"("+a+"RET to close)"; 184 | c.sC();document.onkeypress=null;c.CI.focus();c.CI.onblur=function(){org_html_manager.CI.focus(); 185 | };window.setTimeout(function(){org_html_manager.CI.value=d;},50);},eR:function(c,a){var b=this; 186 | b.Rg=false;b.RC="";b.CI.onblur=null;b.CI.blur();document.onkeypress=OrgHtmlManagerKeyEvent; 187 | },rW:function(){var a=this;a.CL.style.color="#333333";a.hC();},sC:function(){var a=this; 188 | if(!a.Mg){if(a.VIEW==a.PLAIN_VIEW){a.B.removeChild(a.B.firstChild);a.N.D.insertBefore(a.C,a.N.D.firstChild); 189 | a.N.D.scrollIntoView(true);a.Mg=a.MgI;}else{a.Mg=a.MgT;window.scrollTo(0,0);}a.C.style.marginTop="0px"; 190 | a.C.style.top="0px";}},hC:function(){var a=this;if(a.Mg){a.C.style.marginTop="-"+a.CO; 191 | a.C.style.top="-"+a.CO;a.CL.innerHTML="";a.CI.value="";if(a.MgI==a.Mg){a.N.D.removeChild(a.N.D.firstChild); 192 | a.B.insertBefore(a.C,a.B.firstChild);if(a.N.J!=0){a.N.D.scrollIntoView();}}a.Mg=false; 193 | }},getKey:function(){var b=this;var c=b.CI.value;if(0==c.length){if(b.Hg){b.showHelp(); 194 | return;}if(b.Mg&&!b.Rg){b.rW();}return;}if(b.Mg&&!b.Rg){b.rW();return;}else{if(b.Hg){b.showHelp(); 195 | b.CI.value="";return;}else{if(b.Rg){return;}}}b.CI.value="";b.CI.blur();if(b.HIDE_TOC&&b.TOC==b.N&&"v"!=c&&"V"!=c&&"\t"!=c){c="b"; 196 | }else{if("\t"==c){return true;}else{c=b.trim(c);}}if(1==c.length){if("b"==c){b.poH(); 197 | }else{if("B"==c){b.poH(true);}else{if("c"==c){b.rSH();if(b.VIEW==b.INFO_VIEW||b.VIEW==b.SLIDE_VIEW){b.ss(b.N.J); 198 | }}else{if("i"==c){if(!b.FIXED_TOC){if(b.HIDE_TOC){b.go("?/toc/?");}else{if(0!=b.N.J){b.go(0); 199 | }}}if(null!=b.TL){b.TL.focus();}}else{if("m"==c){b.toggleView(b.N.J);return;}else{if("x"==c){b.sV(b.N.J); 200 | }else{if("n"==c){if(b.N.ST==OrgNode.SF&&b.VIEW==b.PLAIN_VIEW){b.ss(b.N.J);}else{if(b.N.J=e){if(b.S[a].DEPTH==e){b.go(a); 203 | return;}++a;}}b.warn("No next sibling.");return;}else{if("p"==c){if(b.N.J>0){b.go(b.N.J-1); 204 | }else{b.warn("Already first section.");return;}}else{if("P"==c){if(b.N.J>0){var e=b.N.DEPTH; 205 | var a=b.N.J-1;while(a>=0&&b.S[a].DEPTH>=e){if(b.S[a].DEPTH==e){b.go(a);return;}--a; 206 | }}b.warn("No previous sibling.");}else{if("q"==c){if(window.confirm("Really close this file?")){window.close(); 207 | }}else{if("<"==c||"t"==c){if(0!=b.N.J){b.go(0);}else{window.scrollTo(0,0);}}else{if(">"==c||"E"==c||"e"==c){if((b.S.length-1)!=b.N.J){b.go(b.S.length-1); 208 | }else{b.S[b.S.length-1].D.scrollIntoView(true);}}else{if("v"==c){if(window.innerHeight){window.scrollBy(0,window.innerHeight-30); 209 | }else{if(document.documentElement.clientHeight){window.scrollBy(0,document.documentElement.clientHeight-30); 210 | }else{window.scrollBy(0,document.body.clientHeight-30);}}}else{if("V"==c){if(window.innerHeight){window.scrollBy(0,-(window.innerHeight-30)); 211 | }else{if(document.documentElement.clientHeight){window.scrollBy(0,-(document.documentElement.clientHeight-30)); 212 | }else{window.scrollBy(0,-(document.body.clientHeight-30));}}}else{if("u"==c){if(b.N.P!=b.R){b.N=b.N.P; 213 | b.ss(b.N.J);}}else{if("W"==c){b.pV(b.N.J);b.R.DRT=true;b.R_STATE=OrgNode.SU;b.tG(); 214 | b.tG();b.tG();window.print();}else{if("f"==c){if(b.VIEW!=b.INFO_VIEW){b.N.fold(); 215 | b.N.D.scrollIntoView(true);}}else{if("F"==c){if(b.VIEW!=b.INFO_VIEW){b.tG();b.N.D.scrollIntoView(true); 216 | }}else{if("?"==c||"¿"==c){b.showHelp();}else{if("C"==c){if(b.ST.length){b.showTagsIndex(); 217 | }else{b.warn("No Tags found.");}}else{if("H"==c&&b.LINK_HOME){window.document.location.href=b.LINK_HOME; 218 | }else{if("h"==c&&b.LINK_UP){window.document.location.href=b.LINK_UP;}else{if("l"==c){if(""!=b.OCCUR){b.sR(b.RC_H,"Choose HTML-link type: 's' = section, 'o' = occur"); 219 | }else{b.sR(c,"HTML-link:",''+document.title+", Sec. '"+b.rT(b.N.H.innerHTML)+"'","C-c to copy, "); 220 | window.setTimeout(function(){org_html_manager.CI.select();},100);}return;}else{if("L"==c){if(""!=b.OCCUR){b.sR(b.RC_O,"Choose Org-link type: 's' = section, 'o' = occur"); 221 | }else{b.sR(c,"Org-link:","[["+b.BU+b.dT()+"]["+document.title+", Sec. '"+b.rT(b.N.H.innerHTML)+"']]","C-c to copy, "); 222 | window.setTimeout(function(){org_html_manager.CI.select();},100);}return;}else{if("U"==c){if(""!=b.OCCUR){b.sR(b.RC_P,"Choose Org-link type: 's' = section, 'o' = occur"); 223 | }else{b.sR(c,"Plain URL Link:",b.BU+b.dT(),"C-c to copy, ");window.setTimeout(function(){org_html_manager.CI.select(); 224 | },100);}return;}else{if("g"==c){b.sR(c,"Enter section number:");return;}else{if("o"==c){if(""!=b.OCCUR){b.sR(c,"Occur:",b.OCCUR,"RET to use previous, DEL "); 225 | }else{b.sR(c,"Occur:",b.OCCUR);}window.setTimeout(function(){org_html_manager.CI.value=org_html_manager.OCCUR; 226 | org_html_manager.CI.select();},100);return;}else{if("s"==c){if(""!=b.OCCUR){b.sR(c,"Search forward:",b.OCCUR,"RET to use previous, DEL "); 227 | }else{b.sR(c,"Search forward:",b.OCCUR);}window.setTimeout(function(){org_html_manager.CI.value=org_html_manager.OCCUR; 228 | org_html_manager.CI.select();},100);return;}else{if("S"==c){if(""==b.OCCUR){c="s"; 229 | b.sR(c,"Search forward:");}else{b.RC=c;b.eRC();}return;}else{if("r"==c){if(""!=b.OCCUR){b.sR(c,"Search backwards:",b.OCCUR,"RET to use previous, DEL "); 230 | }else{b.sR(c,"Search backwards:",b.OCCUR);}window.setTimeout(function(){org_html_manager.CI.value=org_html_manager.OCCUR; 231 | org_html_manager.CI.select();},100);return;}else{if("R"==c){if(""==b.OCCUR){c="r"; 232 | b.sR(c,"Search backwards:");}else{b.RC=c;b.eRC();}return;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return; 233 | },eRC:function(){var j=this;var a=j.RC;var k=j.trim(j.CI.value);j.eR();if(""==a||""==k){j.hC(); 234 | return;}if(a=="g"){var f=j.SN_MAP[k];if(null!=f){j.hC();j.go(f.J);return;}j.warn("Goto section: no such section.",false,k); 235 | return;}else{if(a=="s"){if(""==k){return false;}if(j.SHO){j.rSH();}var g=j.OCCUR; 236 | var e=0;if(k==j.OCCUR){e++;}j.OCCUR=k;j.mSR();for(var d=j.N.J+e;d-1;--d){if(j.sIO(d)){j.hC(); 242 | j.go(j.S[d].J);return;}}j.warn("Search backwards: text not found.",false,j.OCCUR); 243 | j.OCCUR=g;return;}else{if(a=="R"){for(var d=j.N.J-1;d>-1;--d){k=j.rT(j.S[d].H.innerHTML); 244 | if(j.sIO(d)){j.hC();j.go(j.S[d].J);return;}}j.warn("Search backwards: text not found.",false,j.OCCUR); 245 | return;}else{if(a=="o"){if(""==k){return false;}if(j.SHO){j.rSH();}var g=j.OCCUR; 246 | j.OCCUR=k;j.mSR();var b=new Array();for(var d=0;d=1;--d){OrgNode.sE(j.S[b[d]].F); 250 | }j.ss(b[0]);}else{if(a==j.RC_O){var h=k.charAt(0);if("s"==h){j.sR(j.RC_NULL,"Org-link to this section:","[["+j.BU+j.dT()+"]["+document.title+", Sec. '"+j.rT(j.N.H.innerHTML)+"']]","C-c to copy, "); 251 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{if("o"==h){j.sR(j.RC_NULL,"Org-link, occurences of ""+j.OCCUR+"":","[["+j.BU+"?OCCUR="+j.OCCUR+"]["+document.title+", occurences of '"+j.OCCUR+"']]","C-c to copy, "); 252 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{j.warn(h+": No such link type!"); 253 | }}}else{if(a==j.RC_H){var h=k.charAt(0);if("s"==h){j.sR(j.RC_NULL,"HTML-link to this section:",''+document.title+", Sec. '"+j.rT(j.N.H.innerHTML)+"'","C-c to copy, "); 254 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{if("o"==h){j.sR(j.RC_NULL,"HTML-link, occurences of ""+j.OCCUR+"":",''+document.title+", occurences of '"+j.OCCUR+"'","C-c to copy, "); 255 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{j.warn(h+": No such link type!"); 256 | }}}else{if(a==j.RC_P){var h=k.charAt(0);if("s"==h){j.sR(j.RC_NULL,"Plain-link to this section:",j.BU+j.dT(),"C-c to copy, "); 257 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{if("o"==h){j.sR(j.RC_NULL,"Plain-link, occurences of ""+j.OCCUR+"":",j.BU+"?OCCUR="+j.OCCUR,"C-c to copy, "); 258 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{j.warn(h+": No such link type!"); 259 | }}}}}}}}}}}},dT:function(b){if(null==b){b=this.N;}var c="#"+this.N.I;for(var a in b.iTF){if(!a.match(this.SIDX)){c=a; 260 | break;}}return c;},mSR:function(){var a=this.OCCUR.replace(/>/g,">").replace(/]").replace(/\"/g,"""); 261 | this.SCX=new RegExp(">([^<]*)?("+a+")([^>]*)?<","ig");},sIO:function(c){var b=this; 262 | var a=false;if(null!=b.S[c]){if(b.SCX.test(b.S[c].H.innerHTML)){a=true;b.sSH(b.S[c].H); 263 | b.S[c].HH=true;b.SHO=true;}if(b.SCX.test(b.S[c].F.innerHTML)){a=true;b.sSH(b.S[c].F); 264 | b.S[c].HH=true;b.SHO=true;}return a;}return false;},sSH:function(b){var a=b.innerHTML; 265 | b.innerHTML=a.replace(this.SCX,'>$1$2$3<'); 266 | },rSH:function(){var c=this;for(var b=0;bclick here to proceed.

Keyboard Shortcuts

org-info.js, v. 0.1.7.1
? / ¿show this help screen
Moving around
n / pgoto the next / previous section
N / Pgoto the next / previous sibling
t / Egoto the first / last section
ggoto section...
ugo one level up (parent section)
i / Cshow table of contents / tags index
b / Bgo back to last / forward to next visited section.
h / Hgo to main index in this directory / link HOME page
View
m / xtoggle the view mode between info and plain / slides
f / Ffold current section / whole document (plain view only)
Searching
s / rsearch forward / backward....
S / Rsearch again forward / backward
ooccur-mode
cclear search-highlight
Misc
l / L / Udisplay HTML link / Org link / Plain-URL
v / Vscroll down / up
WPrint

Press any key or click here to proceed.'; 274 | window.scrollTo(0,0);}else{if(a.PLAIN_VIEW==a.LVM){a.pV();}else{if(a.SLIDE_VIEW==a.LVM){a.sV(); 275 | }}a.ss(a.N.J);}},showTagsIndex:function(){var e=this;if(e.Rg){e.eR();}else{if(e.Mg){e.rW(); 276 | }}e.Hg=e.Hg?0:1;if(e.Hg){e.LVM=e.VIEW;if(e.PLAIN_VIEW==e.VIEW){e.iV(true);}if(null==e.TAGS_INDEX){e.TAGS_INDEX='Press any key or click here to proceed.

Click the headlines to expand the contents.

Index of Tags

'; 277 | for(var d=0;d

"+b+'

";}e.TAGS_INDEX+='
Press any key or click here to proceed.'; 281 | }e.W.innerHTML=e.TAGS_INDEX;window.scrollTo(0,0);}else{if(e.PLAIN_VIEW==e.LVM){e.pV(); 282 | }else{if(e.SLIDE_VIEW==e.LVM){e.sV();}}e.ss(e.N.J);}},runHooks:function(b,a){if(this.HOOKS.run_hooks&&this.HOOKS[b]){for(var c=0; 283 | c=0; 285 | --b){if(this.HOOKS[a][b]==c){this.HOOKS[a].splice(b,1);}}}}};function OrgHtmlManagerKeyEvent(b){var d; 286 | if(!b){b=window.event;}if(b.which){d=b.which;}else{if(b.keyCode){d=b.keyCode;}}if(b.ctrlKey){return; 287 | }var a=String.fromCharCode(d);if(b.shiftKey){org_html_manager.CI.value=org_html_manager.CI.value+a; 288 | }else{org_html_manager.CI.value=org_html_manager.CI.value+a.toLowerCase();}org_html_manager.getKey(); 289 | }function OrgHtmlManagerLoadCheck(){org_html_manager.init();} -------------------------------------------------------------------------------- /assets/postamable.html: -------------------------------------------------------------------------------- 1 |
2 |
5 | 6 |

I seek refuge in God, from Satan the rejected. Generated by: %c. Written by: %a, by the date of: %d. Last build date: %C.

7 | 8 |
9 | 10 | -------------------------------------------------------------------------------- /assets/preamble.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /assets/style/comments.css: -------------------------------------------------------------------------------- 1 | /* ========================================================================== */ 2 | /* Generic styling */ 3 | /* ========================================================================== */ 4 | #isso-thread * { 5 | /* Reset */ 6 | -webkit-box-sizing: border-box; 7 | -moz-box-sizing: border-box; 8 | box-sizing: border-box; 9 | font-family: "BArial" 10 | } 11 | 12 | /* ========================================================================== */ 13 | /* Thread heading area */ 14 | /* ========================================================================== */ 15 | #isso-thread { 16 | padding: 0; 17 | margin: 0; 18 | } 19 | h4.isso-thread-heading { 20 | color: #555; 21 | font-weight: bold; 22 | } 23 | .isso-feedlink { 24 | float: right; 25 | padding-left: 1em; 26 | } 27 | .isso-feedlink a { 28 | font-size: 0.8em; 29 | vertical-align: bottom; 30 | } 31 | 32 | /* ========================================================================== */ 33 | /* Comments */ 34 | /* ========================================================================== */ 35 | 36 | .isso-comment { 37 | max-width: 68em; 38 | margin: 0 auto; 39 | } 40 | .isso-preview .isso-comment { 41 | padding-top: 0; 42 | margin: 0; 43 | } 44 | .isso-comment:not(:first-of-type), 45 | .isso-follow-up .isso-comment { 46 | border-top: 1px solid rgba(0, 0, 0, 0.1); 47 | margin-bottom: 0.5em; 48 | } 49 | .isso-avatar { 50 | display: block; 51 | float: left; 52 | margin: 0.95em 0.95em 0; 53 | } 54 | .isso-avatar svg { 55 | max-width: 48px; 56 | max-height: 48px; 57 | width: 100%; 58 | height: 100%; 59 | border: 1px solid rgba(0, 0, 0, 0.2); 60 | border-radius: 3px; 61 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); 62 | } 63 | .isso-text-wrapper { 64 | display: block; 65 | padding: 0.95em; 66 | } 67 | .isso-follow-up { 68 | /* padding-left: calc(7% + 20px); */ 69 | } 70 | .isso-comment-footer { 71 | font-size: 0.95em; 72 | } 73 | .isso-comment-header { 74 | font-size: 0.85em; 75 | } 76 | .isso-comment-header a { 77 | text-decoration: none; 78 | } 79 | /* Only for comment header, spacer between up-/downvote should have no padding */ 80 | .isso-comment-header .isso-spacer { 81 | padding: 0 6px; 82 | } 83 | .isso-spacer, 84 | .isso-permalink, 85 | .isso-note, 86 | .isso-parent { 87 | color: gray; 88 | font-weight: normal; 89 | text-shadow: none; 90 | } 91 | .isso-spacer:hover, 92 | .isso-permalink:hover, 93 | .isso-note:hover, 94 | .isso-parent:hover { 95 | color: #606060; 96 | } 97 | .isso-note { 98 | float: right; 99 | } 100 | .isso-author { 101 | /* font-weight: bold; */ 102 | color: #555; 103 | } 104 | .isso-page-author-suffix { 105 | font-weight: bold; 106 | color: #2c2c2c; 107 | } 108 | .isso-textarea, 109 | .isso-preview { 110 | margin-top: 0.2em; 111 | width: 100%; 112 | border: 1px solid #f0f0f0; 113 | border-radius: 2px; 114 | box-shadow: 0 0 2px #888; 115 | } 116 | .isso-text p { 117 | margin-top: 0.2em; 118 | font-size: 14px !important; 119 | 120 | } 121 | .isso-text p:last-child { 122 | margin-bottom: 0.2em; 123 | } 124 | .isso-text h1, 125 | .isso-text h2, 126 | .isso-text h3, 127 | .isso-text h4, 128 | .isso-text h5, 129 | .isso-text h6 { 130 | font-size: 130%; 131 | font-weight: bold; 132 | } 133 | .isso-comment-footer { 134 | font-size: 0.80em; 135 | color: gray; 136 | clear: left; 137 | } 138 | .isso-feedlink, 139 | .isso-comment-footer a { 140 | font-weight: bold; 141 | text-decoration: none; 142 | } 143 | .isso-feedlink:hover, 144 | .isso-comment-footer a:hover { 145 | color: #111111; 146 | text-shadow: #aaaaaa 0 0 1px; 147 | } 148 | .isso-comment-footer > a { 149 | position: relative; 150 | top: .2em; 151 | } 152 | .isso-comment-footer > a + a { 153 | padding-left: 1em; 154 | } 155 | .isso-comment-footer .isso-votes { 156 | color: gray; 157 | } 158 | .isso-upvote svg, 159 | .isso-downvote svg { 160 | position: relative; 161 | top: .2em; 162 | } 163 | /* Reply postbox under existing comment */ 164 | .isso-comment .isso-postbox { 165 | margin-top: 0.8em; 166 | } 167 | .isso-comment.isso-no-votes > * > .isso-comment-footer .isso-votes { 168 | display: none; 169 | } 170 | 171 | /* ========================================================================== */ 172 | /* Postbox */ 173 | /* ========================================================================== */ 174 | .isso-postbox { 175 | max-width: 68em; 176 | margin: 0 auto 2em; 177 | clear: right; 178 | } 179 | .isso-form-wrapper { 180 | display: block; 181 | padding: 0; 182 | } 183 | 184 | 185 | isso-textrea, input:focus{ 186 | outline: none; 187 | } 188 | 189 | 190 | 191 | .isso-textarea, 192 | .isso-preview { 193 | margin: 0 0 .3em; 194 | padding: .4em .8em; 195 | border-radius: 3px; 196 | background-color: #fff; 197 | border: 1px solid rgba(0, 0, 0, 0.2); 198 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); 199 | } 200 | .isso-textarea { 201 | outline: 0; 202 | width: 100%; 203 | resize: none; 204 | } 205 | .isso-form-wrapper input[type=checkbox] { 206 | vertical-align: middle; 207 | position: relative; 208 | bottom: 1px; 209 | margin-left: 0; 210 | } 211 | .isso-notification-section { 212 | font-size: 0.90em; 213 | padding-top: .3em; 214 | display: none; 215 | padding-bottom: 10px; 216 | } 217 | .isso-auth-section { 218 | display: block; 219 | } 220 | .isso-textarea:focus, 221 | .isso-auth-section input:focus { 222 | border-color: rgba(0, 0, 0, 0.8); 223 | } 224 | .isso-input-wrapper { 225 | display: inline-block; 226 | position: relative; 227 | max-width: 25%; 228 | margin: 0; 229 | } 230 | .isso-input-wrapper input { 231 | padding: .3em 10px; 232 | max-width: 100%; 233 | border-radius: 3px; 234 | background-color: #fff; 235 | line-height: 1.4em; 236 | border: 1px solid rgba(0, 0, 0, 0.2); 237 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); 238 | } 239 | .isso-input-wrapper label { 240 | display: inline-block; 241 | line-height: 1.4em; 242 | height: 1.4em; 243 | } 244 | .isso-post-action { 245 | display: block; 246 | margin-top: 20px; 247 | } 248 | .isso-post-action > input { 249 | padding: calc(.3em - 1px); 250 | border-radius: 2px; 251 | border: 1px solid #ccc; 252 | background-color: #ddd; 253 | cursor: pointer; 254 | outline: 0; 255 | line-height: 1.4em; 256 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); 257 | } 258 | .isso-post-action > input:hover { 259 | background-color: #ccc; 260 | } 261 | .isso-post-action > input:active { 262 | background-color: #bbb; 263 | } 264 | 265 | /* ========================================================================== */ 266 | /* Postbox (preview mode) */ 267 | /* ========================================================================== */ 268 | .isso-preview, 269 | .isso-post-action input[name="edit"], 270 | .isso-postbox.isso-preview-mode > .isso-form-wrapper input[name="preview"], 271 | .isso-postbox.isso-preview-mode > .isso-form-wrapper .isso-textarea { 272 | display: none; 273 | } 274 | .isso-postbox.isso-preview-mode > .isso-form-wrapper .isso-preview { 275 | display: block; 276 | } 277 | .isso-postbox.isso-preview-mode > .isso-form-wrapper input[name="edit"] { 278 | display: inline; 279 | } 280 | .isso-preview { 281 | background-color: #f8f8f8; 282 | background: repeating-linear-gradient( 283 | -45deg, 284 | #f8f8f8, 285 | #f8f8f8 10px, 286 | #fff 10px, 287 | #fff 20px 288 | ); 289 | } 290 | 291 | /* ========================================================================== */ 292 | /* Animations */ 293 | /* ========================================================================== */ 294 | 295 | /* "target" means the comment that's being linked to, for example: 296 | * https://example.com/blog/example/#isso-15 297 | */ 298 | .isso-target { 299 | animation: isso-target-fade 5s ease-out; 300 | } 301 | @keyframes isso-target-fade { 302 | 0% { background-color: #eee5a1; } 303 | /* This color should be changed when used on a dark background, 304 | * maybe #3f3c1c for example 305 | */ 306 | } 307 | 308 | /* ========================================================================== */ 309 | /* Media queries */ 310 | /* ========================================================================== */ 311 | @media screen and (max-width:600px) { 312 | .isso-input-wrapper { 313 | display: block; 314 | max-width: 100%; 315 | margin: 0 0 .3em; 316 | } 317 | .isso-input-wrapper input { 318 | width: 100%; 319 | } 320 | .isso-post-action { 321 | margin-top: 0; 322 | } 323 | } 324 | 325 | 326 | @media screen and (min-width:800px) { 327 | .isso-input-wrapper { 328 | display: block; 329 | max-width: 100%; 330 | margin: 0 0 .3em; 331 | } 332 | 333 | .isso-input-wrapper input { 334 | width: 100%; 335 | } 336 | 337 | .isso-post-action { 338 | /* margin-top: 0; */ 339 | } 340 | 341 | } 342 | 343 | 344 | .isso-input-wrapper { 345 | display: block; 346 | max-width: 100%; 347 | margin: 0 0 .3em; 348 | } 349 | 350 | .isso-input-wrapper input { 351 | width: 100%; 352 | } 353 | 354 | .isso-post-action { 355 | /* margin-top: 0; */ 356 | } 357 | 358 | 359 | 360 | .isso-comment:not(.isso-follow-up .isso-comment)::after { 361 | content: "*"; 362 | margin-left: 50% 363 | 364 | } 365 | 366 | 367 | @media screen and (min-width:720px) { 368 | .isso-input-wrapper { 369 | display: block; 370 | max-width: 100%; 371 | margin: 0 0 .3em; 372 | } 373 | 374 | .isso-input-wrapper input { 375 | width: 100%; 376 | } 377 | 378 | .isso-post-action { 379 | /* margin-top: 0; */ 380 | } 381 | 382 | .isso-textarea { 383 | /* max-width: 55%; */ 384 | } 385 | 386 | 387 | .isso-comment:not(.isso-follow-up .isso-comment)::after { 388 | content: "*"; 389 | color: gray; 390 | margin-left: 30; 391 | font-weight: bold; 392 | font-size: 30px; 393 | } 394 | 395 | 396 | } 397 | 398 | input[type="button"][name="preview"] { 399 | display: none; 400 | } 401 | 402 | .isso-avatar { 403 | display: none; 404 | } 405 | 406 | 407 | 408 | 409 | .isso-delete, .isso-edit { 410 | display: none; 411 | } 412 | -------------------------------------------------------------------------------- /assets/style/gh-fork-ribbon.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * "Fork me on GitHub" CSS ribbon v0.1.1 | MIT License 3 | * https://github.com/simonwhitaker/github-fork-ribbon-css 4 | */ 5 | 6 | /* Left will inherit from right (so we don't need to duplicate code) */ 7 | .github-fork-ribbon { 8 | /* The right and left classes determine the side we attach our banner to */ 9 | position: absolute; 10 | 11 | /* Add a bit of padding to give some substance outside the "stitching" */ 12 | padding: 2px 0; 13 | 14 | /* Set the base colour */ 15 | background-color: #a00; 16 | 17 | /* Set a gradient: transparent black at the top to almost-transparent black at the bottom */ 18 | background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15))); 19 | background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 20 | background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 21 | background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 22 | background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 23 | background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 24 | 25 | /* Add a drop shadow */ 26 | -webkit-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5); 27 | -moz-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5); 28 | box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5); 29 | 30 | /* Set the font */ 31 | font: 700 13px "Helvetica Neue", Helvetica, Arial, sans-serif; 32 | 33 | z-index: 9999; 34 | pointer-events: auto; 35 | } 36 | 37 | .github-fork-ribbon a, 38 | .github-fork-ribbon a:hover { 39 | /* Set the text properties */ 40 | color: #fff; 41 | text-decoration: none; 42 | text-shadow: 0 -1px rgba(0, 0, 0, 0.5); 43 | text-align: center; 44 | 45 | /* Set the geometry. If you fiddle with these you'll also need 46 | to tweak the top and right values in .github-fork-ribbon. */ 47 | width: 200px; 48 | line-height: 20px; 49 | 50 | /* Set the layout properties */ 51 | display: inline-block; 52 | padding: 2px 0; 53 | 54 | /* Add "stitching" effect */ 55 | border-width: 1px 0; 56 | border-style: dotted; 57 | border-color: #fff; 58 | border-color: rgba(255, 255, 255, 0.7); 59 | } 60 | 61 | .github-fork-ribbon-wrapper { 62 | width: 150px; 63 | height: 150px; 64 | position: absolute; 65 | overflow: hidden; 66 | top: 0; 67 | z-index: 9999; 68 | pointer-events: none; 69 | } 70 | 71 | .github-fork-ribbon-wrapper.fixed { 72 | position: fixed; 73 | } 74 | 75 | .github-fork-ribbon-wrapper.left { 76 | left: 0; 77 | } 78 | 79 | .github-fork-ribbon-wrapper.right { 80 | right: 0; 81 | } 82 | 83 | .github-fork-ribbon-wrapper.left-bottom { 84 | position: fixed; 85 | top: inherit; 86 | bottom: 0; 87 | left: 0; 88 | } 89 | 90 | .github-fork-ribbon-wrapper.right-bottom { 91 | position: fixed; 92 | top: inherit; 93 | bottom: 0; 94 | right: 0; 95 | } 96 | 97 | .github-fork-ribbon-wrapper.right .github-fork-ribbon { 98 | top: 42px; 99 | right: -43px; 100 | 101 | -webkit-transform: rotate(45deg); 102 | -moz-transform: rotate(45deg); 103 | -ms-transform: rotate(45deg); 104 | -o-transform: rotate(45deg); 105 | transform: rotate(45deg); 106 | } 107 | 108 | .github-fork-ribbon-wrapper.left .github-fork-ribbon { 109 | top: 42px; 110 | left: -43px; 111 | 112 | -webkit-transform: rotate(-45deg); 113 | -moz-transform: rotate(-45deg); 114 | -ms-transform: rotate(-45deg); 115 | -o-transform: rotate(-45deg); 116 | transform: rotate(-45deg); 117 | } 118 | 119 | 120 | .github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon { 121 | top: 80px; 122 | left: -43px; 123 | 124 | -webkit-transform: rotate(45deg); 125 | -moz-transform: rotate(45deg); 126 | -ms-transform: rotate(45deg); 127 | -o-transform: rotate(45deg); 128 | transform: rotate(45deg); 129 | } 130 | 131 | .github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon { 132 | top: 80px; 133 | right: -43px; 134 | 135 | -webkit-transform: rotate(-45deg); 136 | -moz-transform: rotate(-45deg); 137 | -ms-transform: rotate(-45deg); 138 | -o-transform: rotate(-45deg); 139 | transform: rotate(-45deg); 140 | } 141 | -------------------------------------------------------------------------------- /assets/style/gh-fork-ribbon.ie.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * "Fork me on GitHub" CSS ribbon v0.1.1 | MIT License 3 | * https://github.com/simonwhitaker/github-fork-ribbon-css 4 | */ 5 | 6 | /* IE voodoo courtesy of http://stackoverflow.com/a/4617511/263871 and 7 | * http://www.useragentman.com/IETransformsTranslator */ 8 | 9 | .github-fork-ribbon { 10 | filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#000000', EndColorStr='#000000'); 11 | } 12 | 13 | .github-fork-ribbon-wrapper.right .github-fork-ribbon { 14 | /* IE positioning hack (couldn't find a transform-origin alternative for IE) */ 15 | top: -22px; 16 | right: -62px; 17 | 18 | /* IE8+ */ 19 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865474, M12=-0.7071067811865477, M21=0.7071067811865477, M22=0.7071067811865474, SizingMethod='auto expand')"; 20 | /* IE6 and 7 */ 21 | filter: progid:DXImageTransform.Microsoft.Matrix( 22 | M11=0.7071067811865474, 23 | M12=-0.7071067811865477, 24 | M21=0.7071067811865477, 25 | M22=0.7071067811865474, 26 | SizingMethod='auto expand' 27 | ); 28 | } 29 | 30 | .github-fork-ribbon-wrapper.left .github-fork-ribbon { 31 | top: -22px; 32 | left: -22px; 33 | 34 | /* IE8+ */ 35 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865483, M12=0.7071067811865467, M21=-0.7071067811865467, M22=0.7071067811865483, SizingMethod='auto expand')"; 36 | /* IE6 and 7 */ 37 | filter: progid:DXImageTransform.Microsoft.Matrix( 38 | M11=0.7071067811865483, 39 | M12=0.7071067811865467, 40 | M21=-0.7071067811865467, 41 | M22=0.7071067811865483, 42 | SizingMethod='auto expand' 43 | ); 44 | } 45 | 46 | .github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon { 47 | /* IE positioning hack (couldn't find a transform-origin alternative for IE) */ 48 | top: 12px; 49 | left: -22px; 50 | 51 | 52 | /* IE8+ */ 53 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865474, M12=-0.7071067811865477, M21=0.7071067811865477, M22=0.7071067811865474, SizingMethod='auto expand')"; 54 | /* IE6 and 7 */ 55 | /* filter: progid:DXImageTransform.Microsoft.Matrix( 56 | M11=0.7071067811865474, 57 | M12=-0.7071067811865477, 58 | M21=0.7071067811865477, 59 | M22=0.7071067811865474, 60 | SizingMethod='auto expand' 61 | ); 62 | */} 63 | 64 | .github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon { 65 | top: 12px; 66 | right: -62px; 67 | 68 | /* IE8+ */ 69 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865483, M12=0.7071067811865467, M21=-0.7071067811865467, M22=0.7071067811865483, SizingMethod='auto expand')"; 70 | /* IE6 and 7 */ 71 | filter: progid:DXImageTransform.Microsoft.Matrix( 72 | M11=0.7071067811865483, 73 | M12=0.7071067811865467, 74 | M21=-0.7071067811865467, 75 | M22=0.7071067811865483, 76 | SizingMethod='auto expand' 77 | ); 78 | } 79 | -------------------------------------------------------------------------------- /assets/style/ibm.svg: -------------------------------------------------------------------------------- 1 | 2 | New Project 3 | 4 | 5 | 6 | 10 | 11 | 12 | The 13 | 14 | Mourner’s 15 | 16 | Bench 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /assets/style/main.css: -------------------------------------------------------------------------------- 1 | h2, 2 | h3, 3 | h4, 4 | h5, 5 | h6, 6 | h7, 7 | h8 { 8 | font-weight: 100; 9 | } 10 | 11 | a:link, 12 | a:visited { 13 | color: blue; 14 | } 15 | 16 | .smth p::before { 17 | content: "("; 18 | } 19 | 20 | .smth p::after { 21 | content: ")"; 22 | } 23 | 24 | .tag a { 25 | color: blue; 26 | text-transform: lowercase; 27 | 28 | /* font-style: ital; */ 29 | } 30 | 31 | .tag a:after { 32 | color: #ff0101; 33 | content: " ]"; 34 | } 35 | 36 | .tag a:before { 37 | color: #ff0101; 38 | content: "[ "; 39 | } 40 | 41 | a { 42 | text-decoration: none; 43 | /* border-bottom: 1px dotted #000; */ 44 | } 45 | 46 | body { 47 | font-family: "Arimo", "Amiri", Sans; 48 | } 49 | 50 | p { 51 | unicode-bidi: plaintext; 52 | /* line-height: 1.2; */ 53 | } 54 | 55 | .footpara { 56 | display: inline; 57 | } 58 | 59 | dl, 60 | ol, 61 | ul { 62 | /* font-size: 1.2rem !important; */ 63 | /* line-height: 1.7rem !important; */ 64 | text-align: start !important; 65 | } 66 | 67 | @media screen and (min-width: 1500px) { 68 | .footnotes { 69 | display: none; 70 | } 71 | .footdef { 72 | display: none; 73 | } 74 | } 75 | 76 | #text-table-of-contents a { 77 | color: white; 78 | text-decoration: underline dotted; 79 | } 80 | 81 | .smth { 82 | margin-left: 3px; 83 | } 84 | .smth p { 85 | font-size: 13px; 86 | text-align: left; 87 | } 88 | 89 | @media screen and (max-width: 1089px) { 90 | .smth { 91 | } 92 | html { 93 | font-size: 14px !important; 94 | } 95 | } 96 | 97 | pre.src { 98 | position: relative; 99 | word-wrap: normal; 100 | overflow-x: auto; 101 | white-space: pre; 102 | } 103 | 104 | @media screen and (min-width: 760px) { 105 | p { 106 | text-align: justify; 107 | unicode-bidi: plaintext; 108 | } 109 | figcaption { 110 | margin-top: 5%; 111 | margin-left: 10%; 112 | /* width: 40%; */ 113 | } 114 | .figure-number { 115 | display: none; 116 | } 117 | } 118 | 119 | /* To get the pandoc-generated bibliography to match style, define csl classes. */ 120 | div.csl-entry { 121 | clear: both; 122 | margin-top: 0.5rem; 123 | } 124 | .hanging div.csl-entry { 125 | margin-left: 2rem; 126 | text-indent: -2rem; 127 | } 128 | div.csl-left-margin { 129 | min-width: 2rem; 130 | float: left; 131 | } 132 | div.csl-right-inline { 133 | margin-left: 2rem; 134 | padding-left: 1rem; 135 | } 136 | div.csl-indent { 137 | margin-left: 2rem; 138 | } 139 | div.hanging-indent { 140 | margin-left: 1.5rem; 141 | text-indent: -1.5rem; 142 | } 143 | 144 | div.epigraph > blockquote > footer { 145 | font-style: normal; 146 | } 147 | 148 | div.epigraph > blockquote > footer > cite { 149 | font-style: italic; 150 | } 151 | .header img { 152 | /* max-width: 100px; */ 153 | } 154 | 155 | .header a:link { 156 | text-decoration: none !important; 157 | } 158 | 159 | .header a { 160 | border-bottom: none; 161 | } 162 | 163 | .header a:visited { 164 | text-decoration: none !important; 165 | } 166 | 167 | .header a:hover { 168 | text-decoration: none !important; 169 | } 170 | 171 | .header a:active { 172 | text-decoration: none !important; 173 | } 174 | 175 | table { 176 | border-collapse: collapse; 177 | border-spacing: 20px; 178 | padding: 5px; 179 | } 180 | table td, 181 | table th { 182 | border: 1px solid rgba(0, 0, 0, 0.5); 183 | padding: 5px; 184 | } 185 | 186 | th { 187 | display: table-cell; 188 | vertical-align: inherit; 189 | font-weight: normal; 190 | text-align: -internal-center; 191 | } 192 | 193 | table tr:first-child th { 194 | border-top: 0; 195 | padding: 5px; 196 | } 197 | table tr:last-child td { 198 | border-bottom: 0; 199 | padding: 5px; 200 | } 201 | table tr td:first-child, 202 | table tr th:first-child { 203 | border-left: 0; 204 | padding: 5px; 205 | } 206 | table tr td:last-child, 207 | table tr th:last-child { 208 | border-right: 0; 209 | padding: 5px; 210 | } 211 | 212 | /* Style for the timestamp container */ 213 | .timestamp-wrapper { 214 | color: #004aa2; 215 | } 216 | 217 | .timestamp { 218 | } 219 | 220 | h2 .timestamp-wrapper { 221 | font-size: 17px; 222 | } 223 | 224 | .timestamp-kwd { 225 | display: none; 226 | } 227 | 228 | .notes p { 229 | margin-block-start: 0.4em; 230 | margin-block-end: 0em; 231 | margin-inline-start: 0px; 232 | margin-inline-end: 0px; 233 | } 234 | 235 | /* Common styles for both classes */ 236 | span.done, 237 | span.todo { 238 | font-weight: bold; 239 | text-transform: uppercase; 240 | padding: 2px 10px; 241 | } 242 | 243 | /* Specific style for the "DONE" class */ 244 | span.DONE, 245 | span.TODO, 246 | SPAN.KILL { 247 | opacity: 60%; 248 | font-size: 12px; 249 | color: white; 250 | } 251 | 252 | span.DONE { 253 | background-color: #2e3436; 254 | } 255 | 256 | span.KILL { 257 | background-color: #aaa; 258 | } 259 | 260 | span.TODO { 261 | opacity: 78%; 262 | background-color: red; 263 | } 264 | 265 | .UNEXPORTEDTAG { 266 | display: none; 267 | } 268 | 269 | .PREVIEW { 270 | font-style: italic; 271 | color: gray; 272 | } 273 | 274 | .tag { 275 | border-bottom: 1px dashed #0074ff; 276 | background: rgb(190 215 255 / 10%); 277 | padding-top: 0.2px; 278 | padding-left: 9px; 279 | font-size: 0.9em; 280 | color: #333; 281 | } 282 | 283 | span.tag { 284 | background-color: inherit !important; 285 | font-size: small; 286 | color: darkgray; 287 | font-style: normal !important; 288 | font-weight: bold; 289 | } 290 | 291 | span.tag::after { 292 | content: " ]"; 293 | font-size: smaller; 294 | color: black; 295 | } 296 | 297 | span.tag::before { 298 | content: "[ "; 299 | color: black; 300 | font-size: smaller; 301 | } 302 | 303 | .propert { 304 | background-color: rgba(255, 228, 196, 0.12); 305 | border-bottom: 1px dashed #ff7a00; 306 | padding-top: 0.2px; 307 | padding-left: 9px; 308 | font-size: 0.9em; 309 | color: #333; 310 | } 311 | 312 | .propert a { 313 | color: blue; 314 | /* font-weight: bold; */ 315 | } 316 | 317 | .postscript { 318 | background-color: rgba(255, 240, 245, 0.13); 319 | border-bottom: 1px dashed #d4006e; 320 | padding-top: 0.2px; 321 | padding-left: 9px; 322 | font-size: 0.9em; 323 | color: #333; 324 | } 325 | 326 | .postscript a { 327 | color: blue; 328 | /* text-transform: lowercase; */ 329 | /* font-weight: bold; */ 330 | } 331 | 332 | .inlinetask { 333 | display: none; 334 | } 335 | 336 | /* #content > p:first-of-type::first-letter { */ 337 | /* color: white; */ 338 | /* background-color: black; */ 339 | /* border-radius: 2px; */ 340 | /* /\* box-shadow: 3px 3px 0 red; *\/ */ 341 | /* font-size: 250%; */ 342 | /* padding: 6px 3px; */ 343 | /* margin-right: 6px; */ 344 | /* float: left; */ 345 | /* } */ 346 | 347 | :target { 348 | background-color: #ffa; 349 | } 350 | a:target + .target-text { 351 | background-color: #ffa; 352 | } 353 | li:has(> a:target) { 354 | background-color: #ffa; 355 | } 356 | 357 | .notes { 358 | margin-top: -15px; 359 | } 360 | 361 | .recents-2 { 362 | display: none; 363 | } 364 | 365 | @media screen and (max-width: 1999px) { 366 | .recents-2 { 367 | display: none; 368 | } 369 | .footrecents-2 { 370 | display: none; 371 | } 372 | } 373 | 374 | @media screen and (min-width: 1201px) { 375 | .recents-2 { 376 | display: block !important; 377 | float: right; 378 | clear: right; 379 | margin-right: -50%; 380 | width: 44%; 381 | margin-top: 0.3rem; 382 | margin-bottom: 0; 383 | line-height: 1.3; 384 | vertical-align: baseline; 385 | position: relative; 386 | padding-bottom: 10px; 387 | word-spacing: -2px; 388 | } 389 | .footrecents-2 { 390 | display: none; 391 | } 392 | } 393 | 394 | @media screen and (min-width: 1500px) { 395 | .recents-2 { 396 | display: block !important; 397 | float: right; 398 | clear: right; 399 | margin-right: -80%; 400 | width: 75%; 401 | margin-top: 0.3rem; 402 | margin-bottom: 0; 403 | line-height: 1.3; 404 | vertical-align: baseline; 405 | position: relative; 406 | padding-bottom: 10px; 407 | word-spacing: -2px; 408 | } 409 | .footrecents-2 { 410 | display: none; 411 | } 412 | } 413 | 414 | .resright, 415 | .profile { 416 | display: block; 417 | float: left; 418 | clear: both; 419 | padding: 10px; 420 | max-width: 300px; 421 | } 422 | /* body { */ 423 | /* font-family: Pragmatapro; */ 424 | /* } */ 425 | /* h1, */ 426 | /* h2, */ 427 | /* h3, */ 428 | /* h4, */ 429 | /* h5, */ 430 | /* h6 { */ 431 | /* font-family: Hack; */ 432 | /* font-weight: bolder !important; */ 433 | /* } */ 434 | 435 | /* ul { */ 436 | /* list-style: none; */ 437 | /* margin-left: 0; */ 438 | /* padding-left: 0; */ 439 | /* } */ 440 | 441 | /* li { */ 442 | /* padding-left: 1em; */ 443 | /* text-indent: -1em; */ 444 | /* } */ 445 | 446 | /* li:before { */ 447 | /* content: "- "; */ 448 | /* padding-right: 7px; */ 449 | /* } */ 450 | 451 | h1 { 452 | font-size: x-large; 453 | font-weight: 100 !important; 454 | padding-top: 5px; 455 | } 456 | 457 | a { 458 | word-break: break-all; 459 | } 460 | -------------------------------------------------------------------------------- /assets/style/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font-size: 100%; 23 | font: inherit; 24 | vertical-align: baseline; 25 | } 26 | /* HTML5 display-role reset for older browsers */ 27 | article, aside, details, figcaption, figure, 28 | footer, header, hgroup, menu, nav, section { 29 | display: block; 30 | } 31 | body { 32 | line-height: 1; 33 | } 34 | ol, ul { 35 | list-style: none; 36 | } 37 | blockquote, q { 38 | quotes: none; 39 | } 40 | blockquote:before, blockquote:after, 41 | q:before, q:after { 42 | content: ''; 43 | content: none; 44 | } 45 | table { 46 | border-collapse: collapse; 47 | border-spacing: 0; 48 | } 49 | -------------------------------------------------------------------------------- /assets/style/toc.css: -------------------------------------------------------------------------------- 1 | /* TOC inspired by http://jashkenas.github.com/coffee-script */ 2 | #table-of-contents { 3 | font-size: 10pt; 4 | position: fixed; 5 | right: 0em; 6 | top: 0em; 7 | background: #F9F9F9; 8 | line-height: 12pt; 9 | text-align: right; 10 | box-shadow: 0 0 1em #777777; 11 | -webkit-box-shadow: 0 0 1em #777777; 12 | -moz-box-shadow: 0 0 1em #777777; 13 | -webkit-border-bottom-left-radius: 5px; 14 | -moz-border-radius-bottomleft: 5px; 15 | max-height: 80%; 16 | overflow: auto; 17 | } 18 | 19 | 20 | #table-of-contents ul { 21 | /* width: 20% !important; */ 22 | margin-left: 20px;; 23 | } 24 | @media screen and (min-width: 760px) { 25 | 26 | } 27 | 28 | /* #table-of-contents li { */ 29 | /* width: 90% !important; */ 30 | /* } */ 31 | #table-of-contents h2 { 32 | font-size: 13pt; 33 | max-width: 9em; 34 | border: 0; 35 | font-weight: normal; 36 | padding-left: 0.5em; 37 | padding-right: 0.5em; 38 | padding-top: 0.05em; 39 | padding-bottom: 0.05em; } 40 | #table-of-contents #text-table-of-contents { 41 | display: none; 42 | text-align: left; } 43 | #table-of-contents:hover #text-table-of-contents { 44 | display: block; 45 | padding: 0.5em; 46 | margin-top: -1.5em; } 47 | .code-highlighted { background-color: #ffff00; } 48 | 49 | /* .todo { color: red; } */ 50 | /* .todo.IN_PROGRESS { color: orange;} */ 51 | /* .todo.HOLD { color: orange;} */ 52 | 53 | /* .done { display: none; } */ 54 | .org-center { 55 | margin-left: auto; 56 | margin-right: auto; 57 | text-align: center; 58 | } 59 | 60 | @media (prefers-color-scheme: dark) { 61 | /* body { */ 62 | /* background-color: #151515; */ 63 | /* color: #ddd; */ 64 | /* } */ 65 | #table-of-contents { 66 | color: #eeeeec; 67 | background-color: #2e3436; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /assets/style/tufte.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /* @import url(https://fonts.googleapis.com/css2?family=Marcellus+SC&family=Alegreya:ital,wght@0,400;0,700;1,400&family=Alegreya+SC&display=swap);body { */ 4 | /* color: #333; */ 5 | /* background-color: #fdfefa; */ 6 | /* font-family: Alegreya,serif; */ 7 | /* font-size: 18px; */ 8 | /* line-height: 26px; */ 9 | /* margin: 0 */ 10 | /* }/\* Tufte CSS styles *\/ */ 11 | html { 12 | /* font-size: 15px; */ 13 | } 14 | 15 | body { 16 | counter-reset: sidenote-counter; 17 | max-width: 65%; 18 | margin-left: 1%; 19 | } 20 | 21 | p.subtitle { 22 | font-style: italic; 23 | margin-top: 1rem; 24 | margin-bottom: 1rem; 25 | display: block; 26 | line-height: 1; 27 | } 28 | 29 | .numeral { 30 | font-family: et-book-roman-old-style; 31 | } 32 | 33 | .danger { 34 | color: red; 35 | } 36 | 37 | article { 38 | padding: 5rem 0rem; 39 | } 40 | 41 | @media screen and (min-width: 800px) { 42 | .header, #content { 43 | /* padding-top: 1rem; */ 44 | /* padding-bottom: 1rem; */ 45 | width: 90% !important; 46 | } 47 | /* body { */ 48 | /* width: 60% !important; */ 49 | 50 | /* } */ 51 | } 52 | 53 | /* Chapter Epigraphs */ 54 | div.epigraph { 55 | border-left: 4px solid #888; 56 | margin-left: 9px; 57 | /* padding-left: 1rem; */ 58 | } 59 | } 60 | 61 | div.epigraph > blockquote { 62 | margin-top: 0em; 63 | margin-bottom: 0em; 64 | padding-left: 10px; 65 | margin: 10px 0; 66 | color: #333; 67 | border: 0.2px dashed #ccc; 68 | padding-right: 10px; 69 | 70 | background: rgb(0 0 0 / 3%); 71 | } 72 | 73 | div.epigraph > blockquote, 74 | div.epigraph > blockquote > p { 75 | /* font-style: italic; */ 76 | } 77 | 78 | div.epigraph > blockquote > footer { 79 | font-style: normal; 80 | } 81 | 82 | div.epigraph > blockquote > footer > cite { 83 | font-style: italic; 84 | } 85 | /* end chapter epigraphs styles */ 86 | 87 | dt:not(:first-child), 88 | li:not(:first-child) { 89 | margin-top: 0.25rem; 90 | } 91 | 92 | figure { 93 | padding: 0; 94 | border: 0; 95 | font-size: 100%; 96 | font: inherit; 97 | vertical-align: baseline; 98 | max-width: 55%; 99 | -webkit-margin-start: 0; 100 | -webkit-margin-end: 0; 101 | margin: 0 0 3em 0; 102 | } 103 | 104 | .no-tufte-underline:link { 105 | background: unset; 106 | text-shadow: unset; 107 | } 108 | 109 | a:link, 110 | .tufte-underline, 111 | .hover-tufte-underline:hover { 112 | text-decoration: none; 113 | -webkit-background-size: 114 | 0.05em 1px, 115 | 0.05em 1px, 116 | 1px 1px; 117 | -moz-background-size: 118 | 0.05em 1px, 119 | 0.05em 1px, 120 | 1px 1px; 121 | background-size: 122 | 0.05em 1px, 123 | 0.05em 1px, 124 | 1px 1px; 125 | background-repeat: no-repeat, no-repeat, repeat-x; 126 | background-position: 127 | 0% 93%, 128 | 100% 93%, 129 | 0% 93%; 130 | } 131 | 132 | @media screen and (-webkit-min-device-pixel-ratio: 0) { 133 | a:link, 134 | .tufte-underline, 135 | .hover-tufte-underline:hover { 136 | background-position-y: 87%, 87%, 87%; 137 | } 138 | } 139 | 140 | a:link::selection, 141 | a:link::-moz-selection { 142 | background: #b4d5fe; 143 | } 144 | 145 | /* Sidenotes, margin notes, figures, captions */ 146 | img { 147 | max-width: 700px; 148 | } 149 | 150 | .sidenote, 151 | .marginnote { 152 | float: right; 153 | clear: right; 154 | margin-right: -60%; 155 | width: 50%; 156 | margin-top: 0.3rem; 157 | margin-bottom: 0; 158 | line-height: 1.3; 159 | vertical-align: baseline; 160 | position: relative; 161 | padding-bottom: 10px; 162 | /* word-spacing: -2px; */ 163 | } 164 | 165 | .sidenote-number { 166 | counter-increment: sidenote-counter; 167 | } 168 | 169 | .sidenote-number:after, 170 | .sidenote:before { 171 | font-family: et-book-roman-old-style; 172 | position: relative; 173 | vertical-align: baseline; 174 | } 175 | 176 | .sidenote-number:after { 177 | content: "[ " counter(sidenote-counter) " ]"; 178 | font-size: 0.7rem; 179 | top: -0.5rem; 180 | left: 0.1rem; 181 | color: blue; 182 | } 183 | 184 | .sidenote:before { 185 | content: counter(sidenote-counter) " "; 186 | font-size: 1rem; 187 | top: -0.5rem; 188 | } 189 | 190 | blockquote .sidenote, 191 | blockquote .marginnote { 192 | margin-right: -82%; 193 | min-width: 59%; 194 | text-align: left; 195 | } 196 | 197 | code, 198 | pre > code { 199 | font-size: 1rem; 200 | line-height: 1.42; 201 | -webkit-text-size-adjust: 100%; /* Prevent adjustments of font size after orientation changes in iOS. See https://github.com/edwardtufte/tufte-css/issues/81#issuecomment-261953409 */ 202 | } 203 | 204 | .sans > code { 205 | font-size: 1.2rem; 206 | } 207 | 208 | h1 > code, 209 | h2 > code, 210 | h3 > code { 211 | font-size: 0.8em; 212 | } 213 | 214 | .marginnote > code, 215 | .sidenote > code { 216 | font-size: 1rem; 217 | } 218 | 219 | pre > code { 220 | font-size: 0.9rem; 221 | width: 82%; 222 | margin-left: 2.5%; 223 | overflow-x: auto; 224 | display: block; 225 | } 226 | 227 | pre.fullwidth > code { 228 | width: 90%; 229 | } 230 | 231 | .fullwidth { 232 | max-width: 90%; 233 | clear: both; 234 | } 235 | 236 | span.newthought { 237 | font-variant: small-caps; 238 | font-size: 1.2em; 239 | } 240 | 241 | input.margin-toggle { 242 | display: none; 243 | } 244 | 245 | label.sidenote-number { 246 | display: inline-block; 247 | max-height: 2rem; /* should be less than or equal to paragraph line-height */ 248 | } 249 | 250 | label.margin-toggle:not(.sidenote-number) { 251 | display: none; 252 | } 253 | 254 | .iframe-wrapper { 255 | position: relative; 256 | padding-bottom: 56.25%; /* 16:9 */ 257 | padding-top: 25px; 258 | height: 0; 259 | } 260 | 261 | .iframe-wrapper iframe { 262 | position: absolute; 263 | top: 0; 264 | left: 0; 265 | width: 100%; 266 | height: 100%; 267 | } 268 | 269 | @media (max-width: 760px) { 270 | body { 271 | max-width: 100% !important; 272 | padding-left: 8%; 273 | padding-right: 8%; 274 | margin-left: auto !important; 275 | } 276 | 277 | pre > code { 278 | width: 97%; 279 | } 280 | figure { 281 | max-width: 90%; 282 | } 283 | 284 | label.margin-toggle:not(.sidenote-number) { 285 | display: inline; 286 | } 287 | 288 | .sidenote, 289 | .marginnote { 290 | display: none; 291 | } 292 | 293 | .margin-toggle:checked + .sidenote, 294 | .margin-toggle:checked + .marginnote { 295 | display: block; 296 | float: left; 297 | left: 1rem; 298 | clear: both; 299 | width: 95%; 300 | margin: 1rem 2.5%; 301 | vertical-align: baseline; 302 | position: relative; 303 | } 304 | 305 | label { 306 | cursor: pointer; 307 | } 308 | 309 | div.table-wrapper, 310 | table { 311 | width: 85%; 312 | } 313 | 314 | img { 315 | width: 100%; 316 | } 317 | } 318 | 319 | pre { 320 | overflow: auto; 321 | margin: 1.2em; 322 | word-break: break-word; 323 | word-wrap: normal; 324 | overflow-x: auto; 325 | white-space: pre; 326 | font-family: monospace; 327 | font-size: 13px; 328 | line-height: 1.3em; 329 | } 330 | 331 | .sidenote a, 332 | .footpara a { 333 | word-break: break-all; 334 | } 335 | -------------------------------------------------------------------------------- /content: -------------------------------------------------------------------------------- 1 | ../blog -------------------------------------------------------------------------------- /formats.el: -------------------------------------------------------------------------------- 1 | (setq grid-view (format "%s" "#+begin_export HTML 2 | 3 | 61 | 62 | #+end_export")) 63 | 64 | 65 | (setq arabic-view (f-read-text "~/blog/arabicview")) 66 | 67 | (setq org-export-global-macros 68 | '(("comments" . "(eval (salih/print-text-nodes))") 69 | ("anth" . "(eval (salih/print-text-nodes-anth))") 70 | ("recent" . "(eval (salih/recents))") 71 | ("homecomments" . "(eval (salih/print-text-nodes t))") 72 | ("dis" . "(eval (format \"* Comments \n #+begin_export html\n%s\n#+end_export\" isso-comments ))") 73 | ("b" . "(eval (format \"#+begin_export html\n%s\n#+end_export\" (salih/print-back-links)))") 74 | ("t" . "(eval (concat \"This section was labeled under, or is related to\"))") 75 | ("indx" . "(eval (concat grid-view))") 76 | ("ar" . "(eval (concat arabic-view))") 77 | ("s" . "(eval (concat \"Part of a series on\"))"))) 78 | -------------------------------------------------------------------------------- /id.el: -------------------------------------------------------------------------------- 1 | ;; (require 'ox-tufte) 2 | (require 'org) 3 | (require 'ox-publish) 4 | (require 'org-macs) 5 | (require 'cl-lib) 6 | (require 'format-spec) 7 | (require 'ox) 8 | (require 'ox-publish) 9 | (require 'table) 10 | 11 | (defun org-html-link (link desc info) 12 | "Transcode a LINK object from Org to HTML. 13 | DESC is the description part of the link, or the empty string. 14 | INFO is a plist holding contextual information. See 15 | `org-export-data'." 16 | (let* ((html-ext (plist-get info :html-extension)) 17 | (dot (when (> (length html-ext) 0) ".")) 18 | (link-org-files-as-html-maybe 19 | (lambda (raw-path info) 20 | ;; Treat links to `file.org' as links to `file.html', if 21 | ;; needed. See `org-html-link-org-files-as-html'. 22 | (save-match-data 23 | (cond 24 | ((and (plist-get info :html-link-org-files-as-html) 25 | (let ((case-fold-search t)) 26 | (string-match "\\(.+\\)\\.org\\(?:\\.gpg\\)?$" raw-path))) 27 | (concat (match-string 1 raw-path) dot html-ext)) 28 | (t raw-path))))) 29 | (type (org-element-property :type link)) 30 | (raw-path (org-element-property :path link)) 31 | ;; Ensure DESC really exists, or set it to nil. 32 | (desc (org-string-nw-p desc)) 33 | (path 34 | (cond 35 | ((member type '("http" "https" "ftp" "mailto" "news")) 36 | (url-encode-url (concat type ":" raw-path))) 37 | ((string= "file" type) 38 | ;; During publishing, turn absolute file names belonging 39 | ;; to base directory into relative file names. Otherwise, 40 | ;; append "file" protocol to absolute file name. 41 | (setq raw-path 42 | (org-export-file-uri 43 | (org-publish-file-relative-name raw-path info))) 44 | ;; Possibly append `:html-link-home' to relative file 45 | ;; name. 46 | (let ((home (and (plist-get info :html-link-home) 47 | (org-trim (plist-get info :html-link-home))))) 48 | (when (and home 49 | (plist-get info :html-link-use-abs-url) 50 | (file-name-absolute-p raw-path)) 51 | (setq raw-path (concat (file-name-as-directory home) raw-path)))) 52 | ;; Maybe turn ".org" into ".html". 53 | (setq raw-path (funcall link-org-files-as-html-maybe raw-path info)) 54 | ;; Add search option, if any. A search option can be 55 | ;; relative to a custom-id, a headline title, a name or 56 | ;; a target. 57 | (let ((option (org-element-property :search-option link))) 58 | (if (not option) raw-path 59 | (let ((path (org-element-property :path link))) 60 | (concat raw-path 61 | "#" 62 | (org-publish-resolve-external-link option path t)))))) 63 | (t raw-path))) 64 | (attributes-plist 65 | (org-combine-plists 66 | ;; Extract attributes from parent's paragraph. HACK: Only 67 | ;; do this for the first link in parent (inner image link 68 | ;; for inline images). This is needed as long as 69 | ;; attributes cannot be set on a per link basis. 70 | (let* ((parent (org-export-get-parent-element link)) 71 | (link (let ((container (org-export-get-parent link))) 72 | (if (and (eq 'link (org-element-type container)) 73 | (org-html-inline-image-p link info)) 74 | container 75 | link)))) 76 | (and (eq link (org-element-map parent 'link #'identity info t)) 77 | (org-export-read-attribute :attr_html parent))) 78 | ;; Also add attributes from link itself. Currently, those 79 | ;; need to be added programmatically before `org-html-link' 80 | ;; is invoked, for example, by backends building upon HTML 81 | ;; export. 82 | (org-export-read-attribute :attr_html link))) 83 | (attributes 84 | (let ((attr (org-html--make-attribute-string attributes-plist))) 85 | (if (org-string-nw-p attr) (concat " " attr) "")))) 86 | (cond 87 | ;; Link type is handled by a special function. 88 | ((org-export-custom-protocol-maybe link desc 'html info)) 89 | ;; Image file. 90 | ((and (plist-get info :html-inline-images) 91 | (org-export-inline-image-p 92 | link (plist-get info :html-inline-image-rules))) 93 | (org-html--format-image path attributes-plist info)) 94 | ;; Radio target: Transcode target's contents and use them as 95 | ;; link's description. 96 | ((string= type "radio") 97 | (let ((destination (org-export-resolve-radio-link link info))) 98 | (if (not destination) desc 99 | (format "%s" 100 | (org-export-get-reference destination info) 101 | attributes 102 | desc)))) 103 | ;; Links pointing to a headline: Find destination and build 104 | ;; appropriate referencing command. 105 | ((member type '("custom-id" "fuzzy" "id")) 106 | (let ((destination (if (string= type "fuzzy") 107 | (org-export-resolve-fuzzy-link link info) 108 | (org-export-resolve-id-link link info)))) 109 | (pcase (org-element-type destination) 110 | ;; ID link points to an external file. 111 | (`plain-text 112 | (let ((fragment (concat "" path)) 113 | ;; Treat links to ".org" files as ".html", if needed. 114 | (path (funcall link-org-files-as-html-maybe 115 | destination info))) 116 | (format "%s" 117 | path fragment attributes (or desc destination)))) 118 | ;; Fuzzy link points nowhere. 119 | (`nil 120 | (format "%s" 121 | (or desc 122 | (org-export-data 123 | (org-element-property :raw-link link) info)))) 124 | ;; Link points to a headline. 125 | (`headline 126 | (let ((href (org-html--reference destination info)) 127 | ;; What description to use? 128 | (desc 129 | ;; Case 1: Headline is numbered and LINK has no 130 | ;; description. Display section number. 131 | (if (and (org-export-numbered-headline-p destination info) 132 | (not desc)) 133 | (mapconcat #'number-to-string 134 | (org-export-get-headline-number 135 | destination info) ".") 136 | ;; Case 2: Either the headline is un-numbered or 137 | ;; LINK has a custom description. Display LINK's 138 | ;; description or headline's title. 139 | (or desc 140 | (org-export-data 141 | (org-element-property :title destination) info))))) 142 | (format "%s" href attributes desc))) 143 | ;; Fuzzy link points to a target or an element. 144 | (_ 145 | (if (and destination 146 | (memq (plist-get info :with-latex) '(mathjax t)) 147 | (eq 'latex-environment (org-element-type destination)) 148 | (eq 'math (org-latex--environment-type destination))) 149 | ;; Caption and labels are introduced within LaTeX 150 | ;; environment. Use "ref" or "eqref" macro, depending on user 151 | ;; preference to refer to those in the document. 152 | (format (plist-get info :html-equation-reference-format) 153 | (org-html--reference destination info)) 154 | (let* ((ref (org-html--reference destination info)) 155 | (org-html-standalone-image-predicate 156 | #'org-html--has-caption-p) 157 | (counter-predicate 158 | (if (eq 'latex-environment (org-element-type destination)) 159 | #'org-html--math-environment-p 160 | #'org-html--has-caption-p)) 161 | (number 162 | (cond 163 | (desc nil) 164 | ((org-html-standalone-image-p destination info) 165 | (org-export-get-ordinal 166 | (org-element-map destination 'link #'identity info t) 167 | info '(link) 'org-html-standalone-image-p)) 168 | (t (org-export-get-ordinal 169 | destination info nil counter-predicate)))) 170 | (desc 171 | (cond (desc) 172 | ((not number) "No description for this link") 173 | ((numberp number) (number-to-string number)) 174 | (t (mapconcat #'number-to-string number "."))))) 175 | (format "%s" ref attributes desc))))))) 176 | ;; Coderef: replace link with the reference name or the 177 | ;; equivalent line number. 178 | ((string= type "coderef") 179 | (let ((fragment (concat "coderef-" (org-html-encode-plain-text path)))) 180 | (format "%s" 181 | fragment 182 | (format "class=\"coderef\" onmouseover=\"CodeHighlightOn(this, \ 183 | '%s');\" onmouseout=\"CodeHighlightOff(this, '%s');\"" 184 | fragment fragment) 185 | attributes 186 | (format (org-export-get-coderef-format path desc) 187 | (org-export-resolve-coderef path info))))) 188 | ;; External link with a description part. 189 | ((and path desc) 190 | (format "%s" 191 | (org-html-encode-plain-text path) 192 | attributes 193 | desc)) 194 | ;; External link without a description part. 195 | (path 196 | (let ((path (org-html-encode-plain-text path))) 197 | (format "%s" path attributes path))) 198 | ;; No path, only description. Try to do something useful. 199 | (t 200 | (format "%s" desc))))) 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | (defun org-html--reference (datum info &optional named-only) 212 | (let* ((type (org-element-type datum)) 213 | (user-label 214 | (org-element-property 215 | (pcase type 216 | ((or `headline `inlinetask) 217 | :CUSTOM_ID) 218 | ((or `radio-target `target) 219 | :value) 220 | (_ :name)) 221 | datum)) 222 | (user-label (or user-label 223 | (when-let ((path (org-element-property :ID datum))) 224 | (concat "" path))))) 225 | (cond 226 | ((and user-label 227 | (or (plist-get info :html-prefer-user-labels) 228 | (memq type '(headline inlinetask)))) 229 | user-label) 230 | ((and named-only 231 | (not (memq type '(headline inlinetask radio-target target))) 232 | (not user-label)) 233 | nil) 234 | (t 235 | (org-export-get-reference datum info))))) 236 | 237 | 238 | 239 | 240 | 241 | 242 | (defun org-export--annotate-info (backend info &optional subtreep visible-only ext-plist) 243 | "Annotate the INFO plist according to the BACKEND. 244 | 245 | This is run in the context of the current buffer. 246 | 247 | When optional argument SUBTREEP is non-nil, transcode the 248 | sub-tree at point, extracting information from the headline 249 | properties first. 250 | 251 | When optional argument VISIBLE-ONLY is non-nil, don't process the 252 | contents of hidden elements. 253 | 254 | Optional argument EXT-PLIST, when provided, is a property list 255 | with external parameters overriding Org default settings, but 256 | still inferior to file-local settings." 257 | (let ((parsed-keywords 258 | (delq nil 259 | (mapcar (lambda (o) (and (eq (nth 4 o) 'parse) (nth 1 o))) 260 | (append (org-export-get-all-options backend) 261 | org-export-options-alist)))) 262 | tree modified-tick) 263 | 264 | ;; Run first hook with current back-end's name as argument. 265 | (run-hook-with-args 'org-export-before-processing-hook 266 | (org-export-backend-name backend)) 267 | 268 | (org-export-expand-include-keyword) 269 | (org-export--delete-comment-trees) 270 | (org-macro-initialize-templates org-export-global-macros) 271 | (org-macro-replace-all org-macro-templates parsed-keywords) 272 | 273 | 274 | (org-export-expand-include-keyword) 275 | (org-export--delete-comment-trees) 276 | (org-macro-initialize-templates org-export-global-macros) 277 | (org-macro-replace-all org-macro-templates parsed-keywords) 278 | 279 | 280 | 281 | ;; Refresh buffer properties and radio targets after previous 282 | ;; potentially invasive changes. 283 | (org-set-regexps-and-options) 284 | (org-update-radio-target-regexp) 285 | (setq modified-tick (buffer-chars-modified-tick)) 286 | ;; Possibly execute Babel code. Re-run a macro expansion 287 | ;; specifically for {{{results}}} since inline source blocks 288 | ;; may have generated some more. Refresh buffer properties 289 | ;; and radio targets another time. 290 | (when org-export-use-babel 291 | (org-babel-exp-process-buffer) 292 | (org-macro-replace-all '(("results" . "$1")) parsed-keywords) 293 | (unless (eq modified-tick (buffer-chars-modified-tick)) 294 | (org-set-regexps-and-options) 295 | (org-update-radio-target-regexp)) 296 | (setq modified-tick (buffer-chars-modified-tick))) 297 | ;; Run last hook with current back-end's name as argument. 298 | ;; Update buffer properties and radio targets one last time 299 | ;; before parsing. 300 | (goto-char (point-min)) 301 | (save-excursion 302 | (run-hook-with-args 'org-export-before-parsing-hook 303 | (org-export-backend-name backend))) 304 | (unless (eq modified-tick (buffer-chars-modified-tick)) 305 | (org-set-regexps-and-options) 306 | (org-update-radio-target-regexp)) 307 | (setq modified-tick (buffer-chars-modified-tick)) 308 | ;; Update communication channel with environment. 309 | (setq info 310 | (org-combine-plists 311 | info (org-export-get-environment backend subtreep ext-plist))) 312 | ;; Pre-process citations environment, i.e. install 313 | ;; bibliography list, and citation processor in INFO. 314 | (org-cite-store-bibliography info) 315 | (org-cite-store-export-processor info) 316 | ;; De-activate uninterpreted data from parsed keywords. 317 | (dolist (entry (append (org-export-get-all-options backend) 318 | org-export-options-alist)) 319 | (pcase entry 320 | (`(,p ,_ ,_ ,_ parse) 321 | (let ((value (plist-get info p))) 322 | (plist-put info 323 | p 324 | (org-export--remove-uninterpreted-data value info)))) 325 | (_ nil))) 326 | ;; Install user's and developer's filters. 327 | (setq info (org-export-install-filters info)) 328 | ;; Call options filters and update export options. We do not 329 | ;; use `org-export-filter-apply-functions' here since the 330 | ;; arity of such filters is different. 331 | (let ((backend-name (org-export-backend-name backend))) 332 | (dolist (filter (plist-get info :filter-options)) 333 | (let ((result (funcall filter info backend-name))) 334 | (when result (setq info result))))) 335 | ;; Parse buffer. 336 | (setq tree (org-element-parse-buffer nil visible-only)) 337 | ;; Prune tree from non-exported elements and transform 338 | ;; uninterpreted elements or objects in both parse tree and 339 | ;; communication channel. 340 | (org-export--prune-tree tree info) 341 | (org-export--remove-uninterpreted-data tree info) 342 | ;; Call parse tree filters. 343 | (setq tree 344 | (org-export-filter-apply-functions 345 | (plist-get info :filter-parse-tree) tree info)) 346 | ;; Now tree is complete, compute its properties and add them 347 | ;; to communication channel. This is responsible for setting 348 | ;; :parse-tree to TREE. 349 | (setq info (org-export--collect-tree-properties tree info)) 350 | ;; Process citations and bibliography. Replace each citation 351 | ;; and "print_bibliography" keyword in the parse tree with 352 | ;; the output of the selected citation export processor. 353 | (org-cite-process-citations info) 354 | (org-cite-process-bibliography info) 355 | info)) 356 | 357 | (setq org-id-link-to-org-use-id t) 358 | 359 | 360 | 361 | 362 | (defun org-export-as 363 | (backend &optional subtreep visible-only body-only ext-plist) 364 | "Transcode current Org buffer into BACKEND code. 365 | 366 | BACKEND is either an export back-end, as returned by, e.g., 367 | `org-export-create-backend', or a symbol referring to 368 | a registered back-end. 369 | 370 | If narrowing is active in the current buffer, only transcode its 371 | narrowed part. 372 | 373 | If a region is active, transcode that region. 374 | 375 | When optional argument SUBTREEP is non-nil, transcode the 376 | sub-tree at point, extracting information from the headline 377 | properties first. 378 | 379 | When optional argument VISIBLE-ONLY is non-nil, don't export 380 | contents of hidden elements. 381 | 382 | When optional argument BODY-ONLY is non-nil, only return body 383 | code, without surrounding template. 384 | 385 | Optional argument EXT-PLIST, when provided, is a property list 386 | with external parameters overriding Org default settings, but 387 | still inferior to file-local settings. 388 | 389 | Return code as a string." 390 | (when (symbolp backend) (setq backend (org-export-get-backend backend))) 391 | (org-export-barf-if-invalid-backend backend) 392 | (org-fold-core-ignore-modifications 393 | (save-excursion 394 | (save-restriction 395 | ;; Narrow buffer to an appropriate region or subtree for 396 | ;; parsing. If parsing subtree, be sure to remove main 397 | ;; headline, planning data and property drawer. 398 | (cond ((org-region-active-p) 399 | (narrow-to-region (region-beginning) (region-end))) 400 | (subtreep 401 | (org-narrow-to-subtree) 402 | (goto-char (point-min)) 403 | (org-end-of-meta-data) 404 | ;; Make the region include top heading in the subtree. 405 | ;; This way, we will be able to retrieve its export 406 | ;; options when calling 407 | ;; `org-export--get-subtree-options'. 408 | (when (bolp) (backward-char)) 409 | (narrow-to-region (point) (point-max)))) 410 | ;; Initialize communication channel with original buffer 411 | ;; attributes, unavailable in its copy. 412 | (let* ((org-export-current-backend (org-export-backend-name backend)) 413 | (info (org-combine-plists 414 | (org-export--get-export-attributes 415 | backend subtreep visible-only body-only) 416 | (org-export--get-buffer-attributes))) 417 | (parsed-keywords 418 | (delq nil 419 | (mapcar (lambda (o) (and (eq (nth 4 o) 'parse) (nth 1 o))) 420 | (append (org-export-get-all-options backend) 421 | org-export-options-alist)))) 422 | tree modified-tick) 423 | ;; Update communication channel and get parse tree. Buffer 424 | ;; isn't parsed directly. Instead, all buffer modifications 425 | ;; and consequent parsing are undertaken in a temporary copy. 426 | (org-export-with-buffer-copy 427 | (font-lock-mode -1) 428 | ;; Run first hook with current back-end's name as argument. 429 | (run-hook-with-args 'org-export-before-processing-hook 430 | (org-export-backend-name backend)) 431 | (org-export-expand-include-keyword) 432 | (org-export--delete-comment-trees) 433 | (org-macro-initialize-templates org-export-global-macros) 434 | (org-macro-replace-all org-macro-templates parsed-keywords) 435 | 436 | ;; duplicate 437 | (org-export-expand-include-keyword) 438 | (org-export--delete-comment-trees) 439 | (org-macro-initialize-templates org-export-global-macros) 440 | (org-macro-replace-all org-macro-templates parsed-keywords) 441 | 442 | ;; Refresh buffer properties and radio targets after previous 443 | ;; potentially invasive changes. 444 | (org-set-regexps-and-options) 445 | (org-update-radio-target-regexp) 446 | (setq modified-tick (buffer-chars-modified-tick)) 447 | ;; Possibly execute Babel code. Re-run a macro expansion 448 | ;; specifically for {{{results}}} since inline source blocks 449 | ;; may have generated some more. Refresh buffer properties 450 | ;; and radio targets another time. 451 | (when org-export-use-babel 452 | (org-babel-exp-process-buffer) 453 | (org-macro-replace-all '(("results" . "$1")) parsed-keywords) 454 | (unless (eq modified-tick (buffer-chars-modified-tick)) 455 | (org-set-regexps-and-options) 456 | (org-update-radio-target-regexp)) 457 | (setq modified-tick (buffer-chars-modified-tick))) 458 | ;; Run last hook with current back-end's name as argument. 459 | ;; Update buffer properties and radio targets one last time 460 | ;; before parsing. 461 | (goto-char (point-min)) 462 | (save-excursion 463 | (run-hook-with-args 'org-export-before-parsing-hook 464 | (org-export-backend-name backend))) 465 | (unless (eq modified-tick (buffer-chars-modified-tick)) 466 | (org-set-regexps-and-options) 467 | (org-update-radio-target-regexp)) 468 | (setq modified-tick (buffer-chars-modified-tick)) 469 | ;; Update communication channel with environment. 470 | (setq info 471 | (org-combine-plists 472 | info (org-export-get-environment backend subtreep ext-plist))) 473 | ;; Pre-process citations environment, i.e. install 474 | ;; bibliography list, and citation processor in INFO. 475 | (org-cite-store-bibliography info) 476 | (org-cite-store-export-processor info) 477 | ;; De-activate uninterpreted data from parsed keywords. 478 | (dolist (entry (append (org-export-get-all-options backend) 479 | org-export-options-alist)) 480 | (pcase entry 481 | (`(,p ,_ ,_ ,_ parse) 482 | (let ((value (plist-get info p))) 483 | (plist-put info 484 | p 485 | (org-export--remove-uninterpreted-data value info)))) 486 | (_ nil))) 487 | ;; Install user's and developer's filters. 488 | (setq info (org-export-install-filters info)) 489 | ;; Call options filters and update export options. We do not 490 | ;; use `org-export-filter-apply-functions' here since the 491 | ;; arity of such filters is different. 492 | (let ((backend-name (org-export-backend-name backend))) 493 | (dolist (filter (plist-get info :filter-options)) 494 | (let ((result (funcall filter info backend-name))) 495 | (when result (setq info result))))) 496 | ;; Parse buffer. 497 | (setq tree (org-element-parse-buffer nil visible-only)) 498 | ;; Prune tree from non-exported elements and transform 499 | ;; uninterpreted elements or objects in both parse tree and 500 | ;; communication channel. 501 | (org-export--prune-tree tree info) 502 | (org-export--remove-uninterpreted-data tree info) 503 | ;; Call parse tree filters. 504 | (setq tree 505 | (org-export-filter-apply-functions 506 | (plist-get info :filter-parse-tree) tree info)) 507 | ;; Now tree is complete, compute its properties and add them 508 | ;; to communication channel. 509 | (setq info (org-export--collect-tree-properties tree info)) 510 | ;; Process citations and bibliography. Replace each citation 511 | ;; and "print_bibliography" keyword in the parse tree with 512 | ;; the output of the selected citation export processor. 513 | (org-cite-process-citations info) 514 | (org-cite-process-bibliography info) 515 | ;; Eventually transcode TREE. Wrap the resulting string into 516 | ;; a template. 517 | (let* ((body (org-element-normalize-string 518 | (or (org-export-data tree info) ""))) 519 | (inner-template (cdr (assq 'inner-template 520 | (plist-get info :translate-alist)))) 521 | (full-body (org-export-filter-apply-functions 522 | (plist-get info :filter-body) 523 | (if (not (functionp inner-template)) body 524 | (funcall inner-template body info)) 525 | info)) 526 | (template (cdr (assq 'template 527 | (plist-get info :translate-alist)))) 528 | (output 529 | (if (or (not (functionp template)) body-only) full-body 530 | (funcall template full-body info)))) 531 | ;; Call citation export finalizer. 532 | (setq output (org-cite-finalize-export output info)) 533 | ;; Remove all text properties since they cannot be 534 | ;; retrieved from an external process. Finally call 535 | ;; final-output filter and return result. 536 | (org-no-properties 537 | (org-export-filter-apply-functions 538 | (plist-get info :filter-final-output) 539 | output info))))))))) 540 | -------------------------------------------------------------------------------- /tadwin.el: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env /Users/l/.emacs.d/bin/doomscript 2 | (provide 'tadwin) 3 | (require 'doom-start) 4 | (load "~/blog/id.el") 5 | (load "~/blog/formats.el") 6 | 7 | (setq ess-ask-for-ess-directory nil) 8 | 9 | 10 | (defun salih/recents (d) 11 | (if d 12 | (s-replace-all '(("class=\"outline" . "class=\"recents") 13 | ("

Posts

" . 14 | "

Top of My Stack

")) 15 | (salih/org-string-to-html 16 | (salih/org-get-subtree-as-org-string 17 | "~/blog/content/stack.org" "Posts"))) 18 | (s-replace-all '(("class=\"outline" . "class=\"footrecents") 19 | ("

Posts

" . 20 | "

Top of My Stack

")) 21 | (salih/org-string-to-html 22 | (salih/org-get-subtree-as-org-string 23 | "~/blog/content/stack.org" "Posts"))))) 24 | 25 | 26 | (advice-add 'org-html-stable-ids--get-reference :override 27 | (lambda (orig-fun datum info) 28 | (if org-html-stable-ids 29 | (let ((cache (plist-get info :internal-references)) 30 | (id (org-html-stable-ids--extract-id datum)) 31 | (RID (org-element-property :ID datum))) 32 | (if (org-roam-node-from-id RID) RID 33 | (or (car (rassq datum cache)) 34 | (progn (while (assoc id cache) 35 | (setq id (org-html--update-string-with-underscore id))) 36 | (when id (push (cons id datum) 37 | cache) 38 | (plist-put info :internal-references cache) 39 | id))))) 40 | 41 | (funcall orig-fun datum info)))) 42 | 43 | 44 | (setq header (with-temp-buffer 45 | (insert-file-contents "assets/head.html") 46 | (buffer-string))) 47 | (setq preamble (with-temp-buffer 48 | (insert-file-contents "assets/preamble.html") 49 | (buffer-string))) 50 | 51 | (setq postamalbe (with-temp-buffer 52 | (insert-file-contents "assets/postamable.html") 53 | (buffer-string))) 54 | 55 | (setq org-export-time-stamp-file nil) 56 | (setq org-id-locations-file "~/roam/.orgids") 57 | (defvar salih/org-export-replace-links-counter 0) 58 | 59 | (setq org-html-mathjax-options '((path "https://fastly.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js") 60 | (scale 1.0) 61 | (align "center") 62 | (font "mathjax-modern") 63 | (overflow "overflow") 64 | (tags "ams") 65 | (indent "0em") 66 | (multlinewidth "85%") 67 | (tagindent ".8em") 68 | (tagside "right"))) 69 | 70 | (defun salih/org-string-to-html (org-string) 71 | "Export an Org-mode string to HTML with proper heading levels." 72 | (let* ((org-export-with-toc nil) 73 | (org-export-with-section-numbers nil) 74 | (top-level 75 | (if (string-match "^\\(\\*+\\)\\s-+" org-string) 76 | (length (match-string 1 org-string)) 77 | 1))) 78 | (let ((org-html-toplevel-hlevel top-level)) 79 | (with-temp-buffer 80 | (insert org-string) 81 | (org-export-string-as (buffer-string) 'html t))))) 82 | 83 | 84 | 85 | 86 | 87 | (defun salih/get-date (file &optional node) 88 | (if node 89 | (cdr (org-id-decode node)) 90 | (let ((date (org-publish-find-property file :date nil))) 91 | ;; DATE is a secondary string. If it contains 92 | ;; a time-stamp, convert it to internal format. 93 | ;; Otherwise, use FILE modification time. 94 | (cond ((let ((ts (and (consp date) (assq 'timestamp date)))) 95 | (and ts 96 | (let ((value (org-element-interpret-data ts))) 97 | (and (org-string-nw-p value) 98 | (org-time-string-to-time value)))))) 99 | ((file-exists-p file) 100 | (file-attribute-modification-time (file-attributes file))))))) 101 | 102 | (defun salih/time-less-p (v1 v2 &optional reversed) 103 | (if reversed 104 | (time-less-p timestamp1 timestamp2) 105 | (time-less-p timestamp2 timestamp1))) 106 | 107 | 108 | (defun salih/compare-timestamps (node1 node2) 109 | "Comparison function to sort structs based on timestamp slot." 110 | (let* ((node-1-file (org-roam-node-file node1)) 111 | (node-2-file (org-roam-node-file node2)) 112 | (use-id-1 (or 113 | (cl-search "/sh/" node-1-file) 114 | (cl-search "stack.org" node-1-file))) 115 | (use-id-2 (or 116 | (cl-search "/sh/" node-2-file) 117 | (cl-search "stack.org" node-2-file))) 118 | (timestamp1 (salih/get-date node-1-file (when use-id-1 (org-roam-node-id node1)))) 119 | (timestamp2 (salih/get-date node-2-file (when use-id-2 (org-roam-node-id node2))))) 120 | (time-less-p timestamp2 timestamp1) 121 | ;; (cond ((and use-id-1 (not use-id-2)) t) 122 | ;; ((and use-id-2 (not use-id-1)) nil) 123 | ;; ((and (not use-id-1) (not use-id-2)) (time-less-p timestamp2 timestamp1)) 124 | ;; (t (time-less-p timestamp2 timestamp1))) 125 | )) 126 | 127 | 128 | 129 | 130 | (defun salih/get-back-nodes (id &optional no-sort with-sh) 131 | (let ((backlinks (org-roam-backlinks-get (org-roam-node-from-id id) :unique t)) 132 | nodes '()) 133 | (while backlinks 134 | (let ((shp (or 135 | (cl-search "/sh/" (org-roam-node-file 136 | (org-roam-backlink-source-node (car 137 | backlinks)))) 138 | (cl-search "stack.org" (org-roam-node-file 139 | (org-roam-backlink-source-node (car backlinks))))))) 140 | (if (or (and with-sh shp) (and (not with-sh) (not shp))) 141 | (push (org-roam-backlink-source-node (car backlinks)) nodes))) 142 | (setq backlinks (cdr backlinks))) 143 | (if no-sort (reverse (sort nodes #'salih/compare-timestamps)) 144 | (sort nodes #'salih/compare-timestamps)))) 145 | 146 | 147 | 148 | (defun salih/mkentity (node counter tag &optional astr) 149 | (unless astr 150 | (setq astr "**")) 151 | (let* ((id (org-roam-node-id node)) 152 | (entry (org-roam-node-file (org-roam-node-from-id id))) 153 | (lang (if node (salih/get-node-property node "LANG"))) 154 | (subtitle (if lang (salih/get-node-property node "SUBTITLE"))) 155 | (use-id (or 156 | (cl-search "/sh/" entry) 157 | (cl-search "stack.org" entry))) 158 | (preview nil)) 159 | (if (and (cl-search "blog" (org-roam-node-file node)) (not (cl-search "/t/" (org-roam-node-file node)))) 160 | (if tag 161 | (format "%s %s[[id:%s][%s]]\n#+BEGIN_smth\n%s\n#+END_smth\n" 162 | astr 163 | (if lang 164 | "*Arabic* " 165 | "") 166 | id 167 | (if subtitle 168 | subtitle 169 | (org-roam-node-title node)) 170 | (format-time-string "%a %d %b %Y" (salih/get-date entry (when use-id id)))) 171 | 172 | (format "%s %s. %s [[id:%s][%s]]\n#+BEGIN_smth\n%s\n#+END_smth\n" 173 | astr 174 | counter 175 | (if lang 176 | "*Arabic* " 177 | "") 178 | id 179 | (if subtitle 180 | subtitle 181 | (org-roam-node-title node)) 182 | (format-time-string "%a %d %b %Y" (salih/get-date entry (when use-id id))))) 183 | 184 | ""))) 185 | 186 | 187 | 188 | 189 | (defun salih/compare-org-id (node1 node2) 190 | (let ((timestamp1 (cdr (org-id-decode (org-roam-node-id node1)))) 191 | (timestamp2 (cdr (org-id-decode (org-roam-node-id node2))))) 192 | (time-less-p timestamp1 timestamp2))) 193 | 194 | (defun salih/print-text-nodes (&optional first) 195 | (let* ((nodes (sort (salih/get-back-nodes (if first 196 | (org-roam-node-id 197 | (org-roam-node-from-title-or-alias 198 | "Commentary")) 199 | (org-entry-get nil "ID" t))) 200 | #'salih/compare-org-id)) 201 | (strings '())) 202 | (if first 203 | (push (salih/mkinclude (car (last nodes)) nil) strings) 204 | (while nodes (push (salih/mkinclude (car nodes) nil) 205 | strings) 206 | (setq nodes (cdr nodes)))) 207 | (mapconcat 'identity strings ""))) 208 | 209 | (defun salih/print-text-nodes-anth () 210 | (let* ((nodes (sort (salih/get-back-nodes "3xedczc0i2k0") 211 | #'salih/compare-org-id)) 212 | (strings '())) 213 | (while nodes (push (salih/mkinclude (car nodes) t) 214 | strings) 215 | (setq nodes (cdr nodes))) 216 | (mapconcat 'identity strings ""))) 217 | 218 | 219 | (defun salih/mkinclude (node remove-title &optional astr) 220 | (unless astr 221 | (setq astr "**")) 222 | (let* ((id (org-roam-node-id node)) 223 | (entry (org-roam-node-file (org-roam-node-from-id id))) 224 | (cite (file-name-sans-extension (file-name-nondirectory entry)))) 225 | (if remove-title 226 | (format "#+INCLUDE: \"%s::#%s\" :only-contents t\n\n\n \n/Derived from/ [cite:@%s], no. %s. Appeared: %s\n-----\n" 227 | entry 228 | id 229 | cite 230 | (substring (cl-first (s-split " " (salih/get-node-property node "NOTER_PAGE"))) 1) 231 | (format-time-string "%Y-%m-%d (%H:%M)" (cdr (org-id-decode (org-roam-node-id node))))) 232 | 233 | (format "#+INCLUDE: \"%s::#%s\" :only-contents nil\n" 234 | entry 235 | id)))) 236 | 237 | 238 | (defun salih/get-node-property (node property) 239 | (cdr (assoc property (org-roam-node-properties node)))) 240 | 241 | 242 | 243 | (defun salih/org-get-subtree-as-org-string (file-path heading) 244 | "Get the content of the subtree under a given HEADING in the Org file at FILE-PATH as an Org string." 245 | (with-temp-buffer 246 | ;; Load the Org file 247 | (insert-file-contents file-path) 248 | (org-mode) 249 | (goto-char (point-min)) 250 | ;; Search for the specified heading 251 | (if (re-search-forward (concat "^\\*+ " (regexp-quote heading)) nil t) 252 | (let ((start (line-beginning-position)) 253 | (end (progn 254 | ;; Move to the next heading at the same level or higher 255 | (org-end-of-subtree t t) 256 | (point)))) 257 | ;; Return the substring between start and end 258 | (buffer-substring-no-properties start end)) 259 | (error "Heading '%s' not found in %s" heading file-path)))) 260 | 261 | 262 | 263 | 264 | (defun salih/length (l) 265 | (let ((counter 0)) 266 | (while l 267 | (when (and (car l) (cl-search "blog" (org-roam-node-file (car l)))) 268 | (setq counter (+ counter 1))) 269 | (setq l (cdr l))) 270 | counter)) 271 | 272 | 273 | 274 | (defun salih/include-recents () 275 | (salih/org-string-to-html (org-export-expand-include-keyword))) 276 | 277 | 278 | 279 | (defun salih/get-backlinks-html (&optional tag sh astr) 280 | (let* ((nodes (salih/get-back-nodes (org-entry-get nil "ID" t) tag sh)) 281 | (strings '()) 282 | (counter (salih/length nodes))) 283 | (while nodes (push (salih/org-string-to-html (salih/mkentity 284 | (car nodes) 285 | counter tag astr)) 286 | strings) 287 | (if (and (car nodes) (cl-search "blog" (org-roam-node-file (car nodes)))) 288 | (setq counter (- counter 1))) 289 | (setq nodes (cdr nodes))) 290 | 291 | 292 | (mapconcat 'identity strings ""))) 293 | 294 | (defun salih/print-back-links (&optional tag treat-shorts-as-long) 295 | (concat (salih/get-backlinks-html tag nil) "\n" 296 | (let ((shorts 297 | (salih/get-backlinks-html t t (if treat-shorts-as-long nil "***")))) 298 | (unless (and (equal shorts "")) 299 | (concat (unless treat-shorts-as-long 300 | (salih/org-string-to-html "** Short Posts")) "\n" shorts))))) 301 | 302 | 303 | 304 | (defun salih/get-preview (file) 305 | (if t 306 | nil 307 | (with-temp-buffer 308 | (insert-file-contents file) 309 | (goto-char (point-min)) 310 | (when (re-search-forward "^#\\+BEGIN_PREVIEW$" nil 1) 311 | (goto-char (point-min)) 312 | (let ((beg (+ 1 (re-search-forward "^#\\+BEGIN_PREVIEW$" nil 1))) 313 | (end (progn (re-search-forward "^#\\+END_PREVIEW$" nil 1) 314 | (match-beginning 0)))) 315 | (goto-char beg) 316 | (while (search-forward "\n" end t) 317 | (replace-match " " nil t)) 318 | (buffer-substring beg end)))))) 319 | 320 | (defun salih/delete-index (list) 321 | "Delete items containing the word 'index' from LIST." 322 | (cond 323 | ((null list) nil) 324 | ((atom list) 325 | (if (stringp list) 326 | (unless (string-match-p "index.org" list) 327 | list) 328 | list)) 329 | (t 330 | (let ((car-result (salih/delete-index (car list))) 331 | (cdr-result (salih/delete-index (cdr list)))) 332 | (if (and (null car-result) (null cdr-result)) 333 | nil 334 | (cons car-result cdr-result)))))) 335 | 336 | 337 | (defun salih/org-publish-org-sitemap (title list) 338 | "Sitemap generation function." 339 | (concat "#+OPTIONS: toc:nil") 340 | (org-list-to-subtree (salih/delete-index list))) 341 | 342 | ;; modify this one! 343 | (defun salih/org-publish-org-sitemap-format (entry style project) 344 | "Custom sitemap entry formatting: add date" 345 | (cond ((not (directory-name-p entry)) 346 | (let* ((preview nil) 347 | (title (org-publish-find-title entry project)) 348 | (node (org-roam-node-from-title-or-alias title)) 349 | (lang (if node (salih/get-node-property node "LANG"))) 350 | (subtitle (if lang (salih/get-node-property node "SUBTITLE")))) 351 | (format "%s[[file:%s][%s]]\n#+BEGIN_smth\n%s\n#+END_smth\n" 352 | (if lang 353 | "*Arabic* " 354 | "") 355 | entry 356 | (if subtitle 357 | subtitle 358 | title) 359 | (format-time-string "%a %d %b %Y" (org-publish-find-date entry 360 | project))))) 361 | 362 | ((eq style 'tree) 363 | (file-name-nondirectory (directory-file-name entry))) 364 | (t entry))) 365 | 366 | (defun salih/file-contents (file) 367 | (with-temp-buffer 368 | (insert-file-contents file) 369 | (buffer-string))) 370 | 371 | 372 | ;;; additional settings 373 | (setq org-html-style-default (salih/file-contents "assets/head.html")) 374 | 375 | 376 | (setq org-html-prefer-user-labels t) 377 | 378 | (setq org-export-with-clocks t) 379 | 380 | 381 | (setq org-export-with-clocks t) 382 | 383 | (defun org-html-timestamp (timestamp _contents info) 384 | "Transcode a TIMESTAMP object from Org to HTML. 385 | CONTENTS is nil. INFO is a plist holding contextual 386 | information." 387 | (let* ((ts (org-timestamp-translate timestamp)) 388 | (time (apply #'encode-time (org-parse-time-string ts))) 389 | (formatted-time (format-time-string "[%Y-%m-%d %a %H:%M]" time))) 390 | (format "%s" 391 | (replace-regexp-in-string "--" "–" formatted-time)))) 392 | 393 | 394 | ;; (defun org-drawerkk (name content) 395 | ;; (format "@
%s @
" content)) 396 | 397 | ;; (setq org-html-format-drawer-function 'org-drawerkk) 398 | (setq org-time-stamp-custom-formats '("<%a %b %e %Y>" . "<%a %b %e %Y %H:%M>")) 399 | 400 | (defun org-drawerkk (name content) 401 | (if (s-equals? name "REVIEW_DATA") 402 | "" 403 | (format "
%s
" content))) 404 | 405 | 406 | (setq org-html-format-drawer-function 'org-drawerkk) 407 | 408 | 409 | 410 | (defun salih/org-html-publish-to-tufte-html (plist filename pub-dir) 411 | "Make sure that the file is not already published befeore really publihing 412 | it." 413 | (let* ((rebuild nil) 414 | (html (let* ((org-inhibit-startup t) 415 | (visiting (find-buffer-visiting filename)) 416 | (salih/rebuild nil) 417 | (extension (concat "." (or (plist-get plist :html-extension) 418 | org-html-extension 419 | "html"))) 420 | (work-buffer (or visiting (find-file-noselect filename)))) 421 | (unwind-protect 422 | (with-current-buffer work-buffer 423 | (when (ignore-errors (buffer-local-value 'salih/rebuild work-buffer)) 424 | (setq rebuild t)) 425 | (progn 426 | (org-export-output-file-name extension nil pub-dir))))))) 427 | (when (or (string-match ".*index.*" filename) 428 | rebuild (file-newer-than-file-p filename html)) 429 | (org-html-publish-to-tufte-html plist filename pub-dir)))) 430 | 431 | 432 | 433 | 434 | 435 | (defun salih/set-org-publish-project-alist () 436 | "Set publishing projects for Orgweb and Worg." 437 | (interactive) 438 | (setq org-publish-project-alist 439 | `(("blog-notes" 440 | ;; Directory for source files in org format 441 | :language "en" 442 | :base-directory "./content" 443 | :base-extension "org" 444 | :html-doctype "html5" 445 | :html-head ,header 446 | :html-html5-fancy t 447 | ;; HTML directory 448 | :publishing-directory "public" 449 | :recursive t 450 | :headline-levels 8 451 | :with-sub-superscript nil 452 | :section-numbers nil 453 | :auto-preamble nil 454 | :html-preamble ,preamble 455 | :html-postamble ,postamalbe 456 | 457 | :with-drawers t 458 | :auto-sitemap t 459 | :sitemap-title nil 460 | :sitemap-format-entry salih/org-publish-org-sitemap-format 461 | :sitemap-function salih/org-publish-org-sitemap 462 | :sitemap-sort-files anti-chronologically 463 | :sitemap-filename "sitemap.org" 464 | :sitemap-style tree 465 | :with-toc nil 466 | 467 | :publishing-function salih/org-html-publish-to-tufte-html 468 | :exclude "\!.*\.org" 469 | :makeindex t 470 | :html-head-include-default-style nil) 471 | 472 | ("blog-static" 473 | :base-directory "./content" 474 | :base-extension "css\\|js\\|png\\|jpg\\|html\\|json\\|jpeg\\|gif\\|svg\\|pdf\\|mp3\\|woff2\\|woff" 475 | :publishing-directory "public" 476 | :recursive t 477 | :publishing-function org-publish-attachment) 478 | 479 | ("assets" 480 | :base-directory "./assets" 481 | :base-extension "css\\|js\\|png\\|jpg\\|gif\\|svg\\|pdf\\|mp3\\|woff2\\|woff\\|html\\|md\\|ico" 482 | :publishing-directory "public" 483 | :recursive t 484 | :publishing-function org-publish-attachment) 485 | 486 | ("blog" :components ("blog-notes" "assets" "blog-static"))))) 487 | 488 | (salih/set-org-publish-project-alist) 489 | 490 | 491 | (add-hook! 'org-mode-hook (projectile-mode -1)) 492 | (org-publish-all t) 493 | (remove-hook! 'org-mode-hook (projectile-mode -1)) 494 | 495 | (message "Build Complete!") 496 | (setq org-html-htmlize-output-type nil) ; Disable syntax highlighting 497 | --------------------------------------------------------------------------------