<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Open-Source on Janik von Rotz</title>
    <link>https://janikvonrotz.ch/tags/open-source/</link>
    <description>Recent content in Open-Source on Janik von Rotz</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 30 May 2022 09:14:10 +0200</lastBuildDate>
    <atom:link href="https://janikvonrotz.ch/tags/open-source/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Information technology is still in its infancy</title>
      <link>https://janikvonrotz.ch/2022/05/30/information-technology-is-still-in-its-infancy/</link>
      <pubDate>Mon, 30 May 2022 09:14:10 +0200</pubDate>
      <guid>https://janikvonrotz.ch/2022/05/30/information-technology-is-still-in-its-infancy/</guid>
      <description>&lt;p&gt;I firmly believe that information technology despite being perceived as the most advanced technology, its sill in its infancy. It is an unpopular opinion and therefore requires good arguments.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Regulation&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Information technology as of 2022 is mostly unregulated. Compared to other industries such as medicine or aviation with clinical studies and traceability requirements, you can build and ship a digital product by tomorrow. Being compliance with age restrictions, local policies or data protection laws is a nice-to-have. Information technology needs to be regulated so that it comes of age.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Monopolies&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Most of the data, algorithms and infrastructure belong to a handful companies. These companies have a monopoly on search results, instant messaging and social data. Critical data and infrastructure should no be owned by these companies. They should be owned by the people and managed by the state.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Public Money Public Code&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Public services are often built by private companies. The development is funded with public money (from taxes). Why is that the code of these services is open to the public? Public services must not be treated as intellectual property.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Lack of Competence&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;IT people are high in demand. They end up in well paid position with a lot of perks, which makes their knowledge unavailable for companies with less resources. Many IT people have their knowledge bound to proprietary products and do not understand the broad idea of computer systems. These factors put heavy restrictions on knowledge sharing.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Law enforcement&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The digital age has pushed economic crime to another level. Combating economic crime in the internet requires cooperation of public institutions and international organisations. However, this type of cooperation is hardly to find. Local law enforces have almost no ability to track an internet criminal.&lt;/p&gt;&#xA;&lt;p&gt;Information technology is not mature until these points are not resolved.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The value of code</title>
      <link>https://janikvonrotz.ch/2021/06/11/the-value-of-code/</link>
      <pubDate>Fri, 11 Jun 2021 19:33:08 +0200</pubDate>
      <guid>https://janikvonrotz.ch/2021/06/11/the-value-of-code/</guid>
      <description>&lt;p&gt;Being a disciple to the Open Source movement I often have to explain why it is better to make code public than private. Apart from the usual arguments such as &amp;ldquo;access to better security&amp;rdquo;, &amp;ldquo;trust through transparency&amp;rdquo; or &amp;ldquo;the design is the intellectual property&amp;rdquo;, I came up with the argument of true value. Let me explain.&lt;/p&gt;&#xA;&lt;p&gt;Code is collaborative product. Code can complied into a binary and then executed on a computer. If the code is written to solve a problem for one user or organization, it will not be executed very often. If the code can be reused with extensibility in mind by many users and organizations, it will be executed a lot. So which code is more valuable? Is it the private code that will help a company to solve a specific problem or is it the public code that helps multiple companies solving a related problem and has the potential to be improved over time? This could a be question of perspective, but &amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;The value of code does not depend on the difficulty of the problem it solves, but on how many times it solves a common problem. Computer science has not yet advanced to the point where code does something magical. By making code public it gains the potential to solve a problem multiple times.&lt;/p&gt;&#xA;&lt;p&gt;Note that to run a successful Open Source project, it takes a lot more than making code public. You need people that help building a healthy community, well-written documentations and managing issues.&lt;/p&gt;&#xA;&lt;p&gt;From a business perspective this might be obvious. A problem that is not shared by many is not worth to be solved. In the software industry most of the time one system is built for many people. But do not forget that the value of code still increases if the system is running multiple times for many users.&lt;/p&gt;&#xA;&lt;p&gt;Does this make sense? I am not sure. Help me improve this line of argument in the comment section.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A better web</title>
      <link>https://janikvonrotz.ch/2021/06/01/a-better-web/</link>
      <pubDate>Tue, 01 Jun 2021 11:02:10 +0200</pubDate>
      <guid>https://janikvonrotz.ch/2021/06/01/a-better-web/</guid>
      <description>&lt;p&gt;Use alternative services to make the web more healthy and to stay independent. This guide is separated into a &lt;a href=&#34;#consumer&#34;&gt;Consumer&lt;/a&gt; and a &lt;a href=&#34;#producer&#34;&gt;Producer&lt;/a&gt; section.&lt;/p&gt;&#xA;&lt;h2 id=&#34;consumer&#34;&gt;Consumer&lt;/h2&gt;&#xA;&lt;p&gt;Tools and services for consumers.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Music Streaming&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Buy the music of your favorite artist on &lt;a href=&#34;https://bandcamp.com&#34;&gt;https://bandcamp.com&lt;/a&gt; and use &lt;a href=&#34;https://soundcloud.com&#34;&gt;https://soundcloud.com&lt;/a&gt; to stream.  Quit Spotify, Apple Music or any other Streaming services. Streaming services saved the music industry, but not the artists, only the linked providers ensure a healthy music industry.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Mail&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Use secure independent mail providers such as &lt;a href=&#34;https://protonmail.com/&#34;&gt;https://protonmail.com/&lt;/a&gt;. Avoid Gmail, Outlook or any other tightly integrated mail service.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Chat&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Use &lt;a href=&#34;https://element.io/&#34;&gt;https://element.io/&lt;/a&gt; or &lt;a href=&#34;https://signal.org/&#34;&gt;https://signal.org/&lt;/a&gt; to chat with friends and family. Do not use Whatsapp, Facebook Messenger or Telegram. They do not protect your privacy.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Search&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Search the web with &lt;a href=&#34;https://duckduckgo.com/&#34;&gt;https://duckduckgo.com/&lt;/a&gt;. Try to avoid Google and make DuckDuckGo your default search engine.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Browsing&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Use &lt;a href=&#34;https://www.mozilla.org&#34;&gt;https://www.mozilla.org&lt;/a&gt; to browse the web. It is the only independent browser that actually protects you.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Storage&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Use alternative storage providers such as &lt;a href=&#34;https://www.infomaniak.com/en/kdrive&#34;&gt;https://www.infomaniak.com/en/kdrive&lt;/a&gt;. Do not save your data on GDrive, OneDrive or iCloud.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Photo Library&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Try to ignore the Adobe and its Creative Cloud, use &lt;a href=&#34;https://www.darktable.org/&#34;&gt;https://www.darktable.org/&lt;/a&gt; to manage your photo library. Ensure you have always access to the photo metadata.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Office&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Create documents and spreadsheets with &lt;a href=&#34;https://www.libreoffice.org/&#34;&gt;https://www.libreoffice.org/&lt;/a&gt; or &lt;a href=&#34;https://www.onlyoffice.com/&#34;&gt;https://www.onlyoffice.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Movie Streaming&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Buy movies on &lt;a href=&#34;https://vimeo.com/&#34;&gt;https://vimeo.com/&lt;/a&gt; and try to avoid Netflix, HBO, Disney+ and any other streaming service. Use a TV box from a local internet service provider.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note Taking&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Never ever take notes with OneNote, Google Keep or Evernote. Their note taking format is proprietary and you will never ever get your raw data back. Use &lt;a href=&#34;https://obsidian.md/&#34;&gt;https://obsidian.md/&lt;/a&gt;, &lt;a href=&#34;https://joplinapp.org/&#34;&gt;https://joplinapp.org/&lt;/a&gt; or any other plain-text note taking tool.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Install a Linux-based operating system on your computer. Use user friendly distribution such as &lt;a href=&#34;https://pop.system76.com/&#34;&gt;https://pop.system76.com/&lt;/a&gt; or &lt;a href=&#34;https://ubuntu.com/download/desktop&#34;&gt;https://ubuntu.com/download/desktop&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;News&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Do not consume news from click-driven platforms. Use platforms that aim to restore journalism and believe that quality is greater than quantity. In Switzerland we have &lt;a href=&#34;https://www.republik.ch/&#34;&gt;https://www.republik.ch/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Maps&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Use a map app such as &lt;a href=&#34;https://transportr.app/&#34;&gt;https://transportr.app/&lt;/a&gt; that is based on &lt;a href=&#34;https://www.openstreetmap.org/&#34;&gt;https://www.openstreetmap.org/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;producer&#34;&gt;Producer&lt;/h2&gt;&#xA;&lt;p&gt;Tools and services for businesses and creators.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Groupware&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Office365 or GSuite make your more efficient, but also very dependent. Find a hosting partner and use &lt;a href=&#34;https://nextcloud.com/&#34;&gt;https://nextcloud.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Conference&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Setup &lt;a href=&#34;https://bigbluebutton.org/&#34;&gt;https://bigbluebutton.org/&lt;/a&gt; on a server to host meetings and conference talks. Stay away from Zoom or Google Meetings.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Project Management&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Ditch Microsoft Planner, monday.com, Basecamp, Trello or Asana and use &lt;a href=&#34;https://www.openproject.org/&#34;&gt;https://www.openproject.org/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Business Chat&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Setup &lt;a href=&#34;https://mattermost.org/&#34;&gt;https://mattermost.org/&lt;/a&gt; instead of Slack or Teams.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Business Management Software&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Oracle ERP, Microsoft Dynamics or SAP ERP are big names, but they are not as big as you might think. Use &lt;a href=&#34;https://www.odoo.com&#34;&gt;https://www.odoo.com&lt;/a&gt;, &lt;a href=&#34;https://erpnext.com/&#34;&gt;https://erpnext.com/&lt;/a&gt; or &lt;a href=&#34;https://www.tryton.org/&#34;&gt;https://www.tryton.org/&lt;/a&gt; to manage your business.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Identity Provider&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Do not use Google Login, Azure Login or any third party login provider. Setup &lt;a href=&#34;https://www.keycloak.org/&#34;&gt;https://www.keycloak.org/&lt;/a&gt; to manage identities and granting access.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Analytic&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Use &lt;a href=&#34;https://plausible.io/&#34;&gt;https://plausible.io/&lt;/a&gt; to track visitors on your website.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Code Editor&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Code with &lt;a href=&#34;https://vscodium.com&#34;&gt;https://vscodium.com&lt;/a&gt;. It is the same as VSCode, but the licensing is different.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Hosting&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Find a hosting partner that is not only fluent in Microsoft. The world runs on Linux and Java.&lt;/p&gt;&#xA;&lt;h2 id=&#34;more-alternatives&#34;&gt;More alternatives&lt;/h2&gt;&#xA;&lt;p&gt;Find more alternatives on &lt;a href=&#34;https://opensource.com/alternatives&#34;&gt;https://opensource.com/alternatives&lt;/a&gt;, &lt;a href=&#34;https://degoogle.jmoore.dev/&#34;&gt;https://degoogle.jmoore.dev/&lt;/a&gt; or &lt;a href=&#34;https://alternativeto.net/&#34;&gt;https://alternativeto.net/&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bulk export OneNote notebooks to markdown and other formats</title>
      <link>https://janikvonrotz.ch/2020/07/01/01-bulk-export-onenote-notebooks-to-markdown-and-other-formats/</link>
      <pubDate>Wed, 01 Jul 2020 20:17:34 +0200</pubDate>
      <guid>https://janikvonrotz.ch/2020/07/01/01-bulk-export-onenote-notebooks-to-markdown-and-other-formats/</guid>
      <description>&lt;p&gt;I have decided to ditch corporate software and replace everything with open source software. It is an ongoing process that takes some time. Open source alternatives took some strides in recent years. One of the rising stars is &lt;a href=&#34;https://nextcloud.com/&#34;&gt;Nextcloud&lt;/a&gt;. It is a self-hosted data platform that lets you keep control. Featurewise we do not have to start a discussion. Everything runs in your browser, there is a mobile app and client for all desktops.&lt;/p&gt;&#xA;&lt;p&gt;So in short I ditching OneDrive, Office 365 and move to Nextcloud and LibreOffice. As mentioned there are a lot of constraints. One of them is OneNote. Microsoft has integrated OneNote deeply into their Office ecosystem. The OneNote file format is proprietary and therefore not supported by other note taking app. Moreover OneDrive does not store the Notebooks as files, but simply as immutable links. Getting the data out of OneNote requires you to sync all notebooks with the desktop clients. Below I will show you a PowerShell script that I created to export all my notebooks into different formats.&lt;/p&gt;&#xA;&lt;p&gt;Let my elaborate which formats I&amp;rsquo;ve chosen and why.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Onepkg is used to archive the notebooks.&lt;/li&gt;&#xA;&lt;li&gt;Html preserves drawings best and does not require a client.&lt;/li&gt;&#xA;&lt;li&gt;Docx is used to convert the file into markdown.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Here is the script:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# settings&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ExportPath = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;C:\Users\&lt;/span&gt;$env:USERNAME&lt;span style=&#34;color:#e6db74&#34;&gt;\OneDrive\OneNoteExport\&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Create OneNote application&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$OneNote = New-Object -ComObject OneNote.Application&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Set note hierarchy&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[&lt;span style=&#34;color:#66d9ef&#34;&gt;xml&lt;/span&gt;]$Hierarchy = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$OneNote.GetHierarchy(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;, [&lt;span style=&#34;color:#66d9ef&#34;&gt;Microsoft.Office.InterOp.OneNote.HierarchyScope&lt;/span&gt;]::hsPages, [&lt;span style=&#34;color:#66d9ef&#34;&gt;ref&lt;/span&gt;]$Hierarchy)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Get info foreach notebook&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$Hierarchy.Notebooks.Notebook | ?{$_.name &lt;span style=&#34;color:#f92672&#34;&gt;-eq&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;TODO&amp;#39;&lt;/span&gt;} | %{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $Notebook = $_&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $Name = $Notebook.name&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $NotebookPath = Join-Path -Path $ExportPath -ChildPath $Name&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Export Notebook: &lt;/span&gt;$Name&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    New-Item -Force -Path $NotebookPath -ItemType directory | Out-Null&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $NotebookOnepkgPath = Join-Path -Path $ExportPath -ChildPath &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$($Name)&lt;span style=&#34;color:#e6db74&#34;&gt;.onepkg&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (!(Test-Path -Path $NotebookOnepkgPath)) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Export Notebook as Onepkg: &lt;/span&gt;$NotebookOnepkgPath&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        $OneNote.Publish($Notebook.ID, $NotebookOnepkgPath, &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Get info about each section&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    $Notebook.ChildNodes| ?{$_.isRecycleBin &lt;span style=&#34;color:#f92672&#34;&gt;-ne&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;true&amp;#39;&lt;/span&gt;} | %{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        $Section = $_&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        $SectionIndex = [&lt;span style=&#34;color:#66d9ef&#34;&gt;array&lt;/span&gt;]::indexof($Notebook.ChildNodes, $_)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        $SectionName = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$($SectionIndex)&lt;span style=&#34;color:#e6db74&#34;&gt;_&lt;/span&gt;$($Section.name)&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        $SectionPath = Join-Path -Path $NotebookPath -ChildPath $SectionName&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Processing Section: &lt;/span&gt;$SectionName&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        New-Item -Force -Path $SectionPath -ItemType directory | Out-Null&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# Process pages&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        $Section.ChildNodes | %{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $Page = $_&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $PageIndex = [&lt;span style=&#34;color:#66d9ef&#34;&gt;array&lt;/span&gt;]::indexof($Section.ChildNodes, $_)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $PageName = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$($PageIndex)&lt;span style=&#34;color:#e6db74&#34;&gt;_&lt;/span&gt;$($Page.name)&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;.Split([&lt;span style=&#34;color:#66d9ef&#34;&gt;IO.Path&lt;/span&gt;]::GetInvalidFileNameChars()) -join &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;_&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $PagePath = Join-Path -Path $SectionPath -ChildPath $PageName&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Processing Page: &lt;/span&gt;$PageName&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            New-Item -Force -Path $PagePath -ItemType directory | Out-Null&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $PageHtmPath = Join-Path -Path $PagePath -ChildPath &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;index.htm&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (!(Test-Path -Path $PageHtmPath)) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Export Page as Htm: &lt;/span&gt;$PageHtmPath&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                $OneNote.Publish($Page.ID, $PageHtmPath, &lt;span style=&#34;color:#ae81ff&#34;&gt;7&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $PageDocxPath = Join-Path -Path $PagePath -ChildPath &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;index.docx&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (!(Test-Path -Path $PageDocxPath)) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Export Page as Docx: &lt;/span&gt;$PageDocxPath&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                $OneNote.Publish($Page.ID, $PageDocxPath, &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $PageMdPath = Join-Path -Path $PagePath -ChildPath &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;index.md&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (!(Test-Path -Path $PageMdPath)) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Convert Docx to Md: &lt;/span&gt;$PageMdPath&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                Set-Location $PagePath&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                pandoc.exe --extract-media=./ .\index.docx -o index.md -t gfm&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#75715e&#34;&gt;# Export Attachments&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $xml = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $schema = @{one=&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;”&lt;/span&gt;http&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;:&lt;/span&gt;//schemas.microsoft.com/office/onenote/&lt;span style=&#34;color:#ae81ff&#34;&gt;2013&lt;/span&gt;/onenote&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;”&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $onenote.GetPageContent($Page.ID, [&lt;span style=&#34;color:#66d9ef&#34;&gt;ref&lt;/span&gt;]$xml)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            $xml | Select-Xml -XPath &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;//one:Page/one:Outline/one:OEChildren/one:OE/one:InsertedFile&amp;#34;&lt;/span&gt; -Namespace $schema | %{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                $AttachmentPath = Join-Path -Path $PagePath -ChildPath $_.Node.preferredName&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                Write-Host &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Export Attachment: &lt;/span&gt;$($AttachmentPath)&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                Copy-Item -Force $_.Node.pathCache -Destination $AttachmentPath&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The OneNote desktop client must be started in order to run the script. Converting &lt;code&gt;docx&lt;/code&gt; to &lt;code&gt;markdown&lt;/code&gt; is done using &lt;a href=&#34;https://pandoc.org/&#34;&gt;Pandoc&lt;/a&gt;. I had help from this &lt;a href=&#34;https://www.passbe.com/2019/08/01/bulk-export-onenote-2013-2016-pages-as-html/&#34;&gt;blog post&lt;/a&gt; and this &lt;a href=&#34;https://gist.github.com/heardk/ded40b72056cee33abb18f3724e0a580&#34;&gt;code snippet&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let me know if you have similar plans and if the script worked for you.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
