Open-source News

Intel's oneAPI Support Appears To Be In Good Shape For Blender 3.3

Phoronix - Mon, 08/15/2022 - 17:47
Less than one month away is the release of Blender 3.3 and it looks like Intel's initial oneAPI GPU acceleration is ready and in decent shape for Windows and Linux...

MGLRU v14 Released For Improving Linux Low-Memory Performance

Phoronix - Mon, 08/15/2022 - 17:28
While Linux 6.0 will bring a lot of shiny new features, Multi-Gen LRU (MGLRU) is one of the anticipated changes that isn't going to land now until Linux 6.1. But in the interim, MGLRU v14 was posted today that re-bases the code against 6.0-rc1 to help facilitate more testing of this kernel change that primarily helps Linux systems under memory pressure...

Try Asciidoc instead of Markdown

opensource.com - Mon, 08/15/2022 - 15:00
Try Asciidoc instead of Markdown Seth Kenlon Mon, 08/15/2022 - 03:00 Register or Login to like Register or Login to like

I'm a happy user of the XML-based Docbook markup language. To me, it's a precise, explicit, and detailed system that allows me to have contextual and domain-specific metadata in what I write. Best of all, though, it can be transformed (that's what XML users call it when XML is converted into another format) into nearly any format, including HTML, EPUB, FO for PDF, plain text, and more. With great power comes a lot of typing, though, and sometimes Docbook feels like it's surplus to requirements. Luckily, there's Asciidoc, a system of writing plain text with the same markup-less feel of Markdown, but that transforms to Docbook to take advantage of its precision and flexibility.

Asciidoc rules

Like Markdown, one of the goals of Asciidoc is that you don't really have to learn it. Instead, it aims to be intuitive and natural. You may well have written snippets of valid Asciidoc without realizing it if you've ever added a little style to a plain text document for readability. For instance, if you habitually separate paragraphs with a blank line, then you've written the equivalent of the HTML

or Docbook tag. It seems obvious, and yet in academia separating paragraphs with blank lines isn't generally done, so even this simple convention is technically markup.

Here's the most common syntax.

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles Text styles

Text styles include the basics such as bold, italics, and code font. Most of the notation is relatively intuitive, with the possible exception of italics.

*Bold*

_Italics_

*_Bold and italic_*

`Monospace or code`

Code

Code is marked with backticks or by explicit declaration of a code block.

`Monospace or code`

[source,python]
----
print('a whole code block')
----Headlines

Headings are marked with leading equal signs (=):

= Heading 1 ()

== Heading 2 ()

=== Heading 3 ()

==== Heading 4 ()

===== Heading 5 ()

====== Heading 6 ()

Links

Hyperlinks favor the link first, followed by the word or phrase used to "disguise" the link as text.

This is a http://example.com[hyperlink] that leads to the example.com site.

I don't find this as elegant as Markdown's link notation, but then it's a lot more flexible. For instance, you can add attributes in Asciidoc links:

This is a https://example.com[link,role=external,window=_blank] with the target="_blank" attribute set.

Lots more

Asciidoc also features internal links so you can link from one section to another, a standard for document headers, automatic table of content generation, the ability to include other documents within another, and much much more.

But best of all, Asciidoc is actually standardized. Not everyone knows it, but the term "Markdown" doesn't refer to one markup-light language. Different organizations and groups regularly customize and alter Markdown for their own use, so when you use Markdown you really ought to verify which markdown you're meant to use. Many of the conventions you might have learned from one website using Markdown don't carry over to another site using Markdown. There's essentially no standard for Markdown, and that's resulted in such confusion that the Commonmark.org project has been formed in an attempt to assemble a standardized definition.

Asciidoc was designed from the start with a standard definition, so the tool or website that claims to parse Asciidoc actually does parse all valid Asciidoc, because there's only one valid Asciidoc.

Asciidoc to anything

The point of writing in a markup-light language like Asciidoc is to ensure predictability and consistency when text is parsed. You want a person to write a script, or to run an application someone else has written, to be able to transform your plain text into whatever format works best for them. Sometimes that's HTML (incidentally Markdown's native output format, and fallback language when there's something missing from its own syntax.) Other times it's an EPUB, or a PDF for printing, Docbook, a LibreOffice document, or any number of possible output formats.

There are several tools to help you transform Asciidoc to another format. A popular command is Asciidoctor, which you can install using your package manager. For instance, on Fedora, CentOS, or RHEL:

$ sudo dnf install asciidoctor

On Debian-based systems:

$ sudo apt install asciidoctor

Alternately, you can install it on any OS with Ruby:

$ gem install asciidoctor

Here's a simple example of an Asciidoc document, which you can create using any text editor or even a word processor (like LibreOffice) as long as you save the file as plain text. Most applications expect a plain text document to use the extension .txt, and while it's a convention use the extension .adoc for Asciidoc, it's not necessary. Asciidoctor doesn't require any special extension.

= This is my example document

It's not written in _Markdown_, nor _reStructured Text_.
This is *Asciidoc*.

It can be transformed into nearly any format using the tool `Asciidoctor` and other similar parsers.
Try it for yourself!

To transform an Asciidoc document to HTML, run asciidoctor:

$ asciidoctor example.adoc

The file example.adoc is transformed into HTML5 by default, but you can use different backends to gain access to more formats.

From Asciidoc to XML

My favourite is the Docbook backend, because it transforms my Asciidoc to Docbook XML, allowing me to use my existing Docbook toolchain (custom Makefiles, Apache FOP, xsltproc, xmlto, and so on) to complete my work:

$ asciidoctor --backend docbook5 example.adoc

This outputs Docbook XML. The final two built-in backends are xhtml5 and manpage.

From Asciidoc to EPUB

If you want to turn your writing into an ebook, you can install the EPUB3 backend:

$ gem install asciidoctor-epub3

Transform your Asciidoc into EPUB:

$ asciidoctor-epub3 example.adocFrom Asciidoc to PDF

You can transform Asciidoc directly to PDF, too:

$ gem install asciidoctor-pdf
$ asciidoctor-pdf example.adoc Image by:

(Seth Kenlon, CC BY-SA 4.0)

Who should use Asciidoc

Asciidoc is excellent for technical writers and writers who have precise requirements for how they want text to be organized and parsed. It's a clear and strictly defined markup format that eliminates the confusion of competing Markdown formats, and it transforms to all the major formats. Asciidoc is admittedly more verbose and possibly less intuitive than Markdown, but it's still just plain text so you can author on anything, and Asciidoctor makes processing easy. Next time you write a document for any purpose, consider trying Asciidoc.

Next time you write, use Asciidoc and Asciidoctor as alternatives to Markdown.

Linux Documentation What to read next Markdown beginner's cheat sheet This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How ODT files are structured

opensource.com - Mon, 08/15/2022 - 15:00
How ODT files are structured Jim Hall Mon, 08/15/2022 - 03:00 Register or Login to like Register or Login to like

Word processing files used to be closed, proprietary formats. In some older word processors, the document file was essentially a memory dump from the word processor. While this made for faster loading of the document into the word processor, it also made the document file format an opaque mess.

Around 2005, the Organization for the Advancement of Structured Information Standards (OASIS) group defined an open format for office documents of all types, the Open Document Format for Office Applications (ODF). You may also see ODF referred to as simply "OpenDocument Format" because it is an open standard based on the OpenOffice.org's XML file specification. ODF includes several file types, including ODT for OpenDocument Text documents. There's a lot to explore in an ODT file, and it starts with a zip file.

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles Zip structure

Like all ODF files, ODT is actually an XML document and other files wrapped in a zip file container. Using zip means files take less room on disk, but it also means you can use standard zip tools to examine an ODF file.

I have an article about IT leadership called "Nibbled to death by ducks" that I saved as an ODT file. Since this is an ODF file, which is a zip file container, you can use unzip from the command line to examine it:

$ unzip -l 'Nibbled to death by ducks.odt'
Archive: Nibbled to death by ducks.odt
Length Date Time Name
39 07-15-2022 22:18 mimetype
12713 07-15-2022 22:18 Thumbnails/thumbnail.png
915001 07-15-2022 22:18 Pictures/10000201000004500000026DBF6636B0B9352031.png
10879 07-15-2022 22:18 content.xml
20048 07-15-2022 22:18 styles.xml
9576 07-15-2022 22:18 settings.xml
757 07-15-2022 22:18 meta.xml
260 07-15-2022 22:18 manifest.rdf
0 07-15-2022 22:18 Configurations2/accelerator/
0 07-15-2022 22:18 Configurations2/toolpanel/
0 07-15-2022 22:18 Configurations2/statusbar/
0 07-15-2022 22:18 Configurations2/progressbar/
0 07-15-2022 22:18 Configurations2/toolbar/
0 07-15-2022 22:18 Configurations2/popupmenu/
0 07-15-2022 22:18 Configurations2/floater/
0 07-15-2022 22:18 Configurations2/menubar/
1192 07-15-2022 22:18 META-INF/manifest.xml
970465 17 files

I want to highlight a few elements of the zip file structure:

  1. The mimetype file contains a single line that defines the ODF document. Programs that process ODT files, such as a word processor, can use this file to verify the MIME type of the document. For an ODT file, this should always be:
application/vnd.oasis.opendocument.text
  1. The META-INF directory has a single manifest.xml file in it. This file contains all the information about where to find other components of the ODT file. Any program that reads ODT files starts with this file to locate everything else. For example, the manifest.xml file for my ODT document contains this line that defines where to find the main content:
<manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>
  1. The content.xml file contains the actual content of the document.

  2. My document includes a single screenshot, which is contained in the Pictures directory.

Extracting files from an ODT file

Because the ODT document is just a zip file with a specific structure to it, you can extract files from it. You can start by unzipping the entire ODT file, such as with this unzip command:

$ unzip -q 'Nibbled to death by ducks.odt' -d Nibbled

A colleague recently asked for a copy of the image that I included in my article. I was able to locate the exact location of any embedded image by looking in the META-INF/manifest.xml file. The grep command can display any lines that describe an image:

$ cd Nibbled
$ grep image META-INF/manifest.xml
<manifest:file-entry manifest:full-path="Thumbnails/thumbnail.png" manifest:media-type="image/png"/>
<manifest:file-entry manifest:full-path="Pictures/10000201000004500000026DBF6636B0B9352031.png" manifest:media-type=" image/png”/>

The image I'm looking for is saved in the Pictures folder. You can verify that by listing the contents of the directory:

$ ls -F
Configurations2/ manifest.rdf meta.xml Pictures/ styles.xml
content.xml META-INF/ mimetype settings.xml Thumbnails/

And here it is:

Image by:

(Jim Hall, CC BY-SA 40)

OpenDocument Format

OpenDocument Format (ODF) files are an open file format that can describe word processing files (ODT), spreadsheet files (ODS), presentations (ODP), and other file types. Because ODF files are based on open standards, you can use other tools to examine them and even extract data from them. You just need to know where to start. All ODF files start with the META-INF/manifest.xml file, which is the "root" or "bootstrap" file for the rest of the ODF file format. Once you know where to look, you can find the rest of the content.

Because OpenDocument Format (ODF) are based on open standards, you can use other tools to examine them and even extract data from them. You just need to know where to start.

Image by:

Jonas Leupe on Unsplash

Linux Documentation What to read next How I use the Linux fmt command to format text How I use the Linux sed command to automate file edits Old-school technical writing with groff Create beautiful PDFs in LaTeX A gentle introduction to HTML Writing project documentation in HTML Level up your HTML document with CSS This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Linux 6.0-rc1 Released With Exciting Performance Optimizations, New Hardware Support

Phoronix - Mon, 08/15/2022 - 07:30
After the two week long merge window, Linus Torvalds this afternoon released the first release candidate of Linux 6.0. Over the next roughly two months the Linux 6.0 kernel will stabilize but already from my early testing on various systems it is in nice shape and the features and performance are looking great...

Pages