kibook / s1kd-tools

A set of small, free and open source software tools for manipulating S1000D data.
https://khzae.net/1/s1000d/s1kd-tools
GNU General Public License v3.0
38 stars 13 forks source link

dmTypes #2

Closed enigtique closed 4 years ago

enigtique commented 4 years ago

Hello,

When i do a newdm to make a front matter data module i've a new DM with descript schema and not frontmatter schema.

When i check the .dmtypes file, it's the same descript schema and not frontmatter schema.

It's a mistake or i've forget anything.

Sorry for my english, i'm french.

Thank you.

kibook commented 4 years ago

The default .dmtypes file that is built in to s1kd-newdm does use the descript schema for the typical front matter info codes (such as 001, 009, etc.). This was mostly done for backwards compatibility, since older issues of S1000D didn't have the frontmatter schema, and even the 4.1 project I work with uses a CSDB that doesn't support the frontmatter schema out-of-the-box.

If you want to use a different schema than the default, you need to create your own .dmtypes file. You can either start from scratch, defining only the info codes your project will be using, or you can dump the built-in .dmtypes file as a starting point:

For the XML format:

$ s1kd-newdm --dump-dmtypes-xml >.dmtypes

For the text format:

$ s1kd-newdm --dump-dmtypes >.dmtypes

Inside your .dmtypes file, you'll want definitions like this:

<type infoCode="001" schema="frontmatter" infoName="Title page"/>
<type infoCode="009" schema="frontmatter" infoName="Table of contents"/>

Or, if you're using the text format:

001    frontmatter    Title page
009    frontmatter    Table of contents

If you initialized your CSDB directory with:

$ s1kd-defaults --init

then you should already have a .dmtypes file, and you just need to edit it.

The .dmtypes file must be in the current directory or any parent directory where you're running s1kd-newdm from. Otherwise, s1kd-newdm will fall back to the built-in .dmtypes file. If you need to run s1kd-newdm outside the CSDB directory structure, you can use --dmtypes to specify it explicitly:

$ s1kd-newdm --dmtypes /path/to/csdb/.dmtypes ...

If all else fails, you can also specify the type you want to use for the new DM with --type:

$ s1kd-newdm --code EX-A-00-00-00-00A-009A-D --type frontmatter

Let me know if any of that helped!

enigtique commented 4 years ago

Thank you for your reply. Indeed I went through a dmtypes generated via defaults -i which I then modified.

Then during newDM I always call the same dmTypes for all of my projects.

I'm on S1000D in 4.1 and we use front matters. Our software (ArborText) can automatically generate LOEDM, TOC and Highlight data, but these dms must be in front matter (we have a plugin).

I am developing a csdb from excel, I program a lot in vba among others and your tools allow me to discover new functions and thus make me advance much faster and as I begin in S1000D ...

Obviously your name and deposit will be mentioned in my manual.

There are only two of us using it.