From 212b21bf5dfc904f83658326fa8c6e7377f9edc2 Mon Sep 17 00:00:00 2001
From: Christian Boulanger <boulanger@lhlt.mpg.de>
Date: Mon, 30 Sep 2024 11:59:56 +0200
Subject: [PATCH] Improve output for GS generation

---
 .../tei-to-biblstruct-gs.ipynb                | 29 +++++++------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/convert-anystyle-data/tei-to-biblstruct-gs.ipynb b/convert-anystyle-data/tei-to-biblstruct-gs.ipynb
index 1c4eabf..e7545cd 100644
--- a/convert-anystyle-data/tei-to-biblstruct-gs.ipynb
+++ b/convert-anystyle-data/tei-to-biblstruct-gs.ipynb
@@ -95,12 +95,12 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
+   "execution_count": 10,
    "outputs": [
     {
      "data": {
       "text/plain": "<IPython.core.display.Markdown object>",
-      "text/markdown": "### Processing 10.1111_1467-6478.00057\n - [TEI/bibl](tei-bibl-corrected\\10.1111_1467-6478.00057.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1111_1467-6478.00057.biblstruct.xml)"
+      "text/markdown": "### Processing 10.1111_1467-6478.00057\n - [TEI/bibl](tei-bibl-corrected/10.1111_1467-6478.00057.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1111_1467-6478.00057.biblstruct.xml)"
      },
      "metadata": {},
      "output_type": "display_data"
@@ -116,7 +116,7 @@
     {
      "data": {
       "text/plain": "<IPython.core.display.Markdown object>",
-      "text/markdown": "### Processing 10.1111_1467-6478.00080\n - [TEI/bibl](tei-bibl-corrected\\10.1111_1467-6478.00080.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1111_1467-6478.00080.biblstruct.xml)"
+      "text/markdown": "### Processing 10.1111_1467-6478.00080\n - [TEI/bibl](tei-bibl-corrected/10.1111_1467-6478.00080.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1111_1467-6478.00080.biblstruct.xml)"
      },
      "metadata": {},
      "output_type": "display_data"
@@ -132,7 +132,7 @@
     {
      "data": {
       "text/plain": "<IPython.core.display.Markdown object>",
-      "text/markdown": "### Processing 10.1515_zfrs-1980-0103\n - [TEI/bibl](tei-bibl-corrected\\10.1515_zfrs-1980-0103.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1515_zfrs-1980-0103.biblstruct.xml)"
+      "text/markdown": "### Processing 10.1515_zfrs-1980-0103\n - [TEI/bibl](tei-bibl-corrected/10.1515_zfrs-1980-0103.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1515_zfrs-1980-0103.biblstruct.xml)"
      },
      "metadata": {},
      "output_type": "display_data"
@@ -148,7 +148,7 @@
     {
      "data": {
       "text/plain": "<IPython.core.display.Markdown object>",
-      "text/markdown": "### Processing 10.1515_zfrs-1980-0104\n - [TEI/bibl](tei-bibl-corrected\\10.1515_zfrs-1980-0104.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1515_zfrs-1980-0104.biblstruct.xml)"
+      "text/markdown": "### Processing 10.1515_zfrs-1980-0104\n - [TEI/bibl](tei-bibl-corrected/10.1515_zfrs-1980-0104.xml)\n - [TEI/biblStruct](tei-biblStruct/10.1515_zfrs-1980-0104.biblstruct.xml)"
      },
      "metadata": {},
      "output_type": "display_data"
@@ -169,6 +169,7 @@
     "from copy import deepcopy\n",
     "from lib.string import remove_whitespace\n",
     "from IPython.display import display, Markdown\n",
+    "from pathlib import Path\n",
     "\n",
     "def remove_encoding_declaration(xml_string):\n",
     "    return xml_string.replace('<?xml version=\"1.0\" encoding=\"UTF-8\"?>', '')\n",
@@ -261,8 +262,8 @@
     "\n",
     "        # log\n",
     "        md_lines = [f'### Processing {file_id}']\n",
-    "        md_lines.append(f' - [TEI/bibl]({bibl_path})')\n",
-    "        md_lines.append(f' - [TEI/biblStruct]({biblstruct_path})')\n",
+    "        md_lines.append(f' - [TEI/bibl]({Path(bibl_path).as_posix()})')\n",
+    "        md_lines.append(f' - [TEI/biblStruct]({Path(biblstruct_path).as_posix()})')\n",
     "        display(Markdown(\"\\n\".join(md_lines)))\n",
     "\n",
     "        with (open(bibl_path, 'r', encoding='utf-8') as bibl_file, \n",
@@ -281,21 +282,11 @@
    "metadata": {
     "collapsed": false,
     "ExecuteTime": {
-     "end_time": "2024-09-30T09:49:31.520651200Z",
-     "start_time": "2024-09-30T09:49:30.856013600Z"
+     "end_time": "2024-09-30T09:59:48.158571300Z",
+     "start_time": "2024-09-30T09:59:47.826852300Z"
     }
    },
    "id": "b658a0ceebfc73d9"
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "outputs": [],
-   "source": [],
-   "metadata": {
-    "collapsed": false
-   },
-   "id": "6db741d584bcac88"
   }
  ],
  "metadata": {
-- 
GitLab