Skip to content

Commit a78f727

Browse files
committed
Merge pull request #28 from bruceravel/master
work on specification and dictionary documents
2 parents 3200f06 + b5f60d3 commit a78f727

25 files changed

+2218
-826
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ perl/*.inl
4747
*.out
4848
*.snm
4949
*.toc
50+
latex/auto/*
5051
latex/xdi.log
5152
latex/xdi.pdf
5253
doc/Poster_XAFS15/XDI_Poster.log
54+
55+
specification/auto/*
56+
specification/background_inner.tex
57+
specification/*_inner.tex
58+
specification/xdi_*.log

README.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,13 @@ files containing single-scan XAS data.
1414
not yet been released.**
1515

1616

17-
Specification Document
18-
------------------------
17+
Specification Documents
18+
-----------------------
1919

20+
* The [XDI specification](specification/spec.md), version 1.0.
2021

21-
The
22-
[XDI specification](https://github.com/XraySpectroscopy/XAS-Data-Interchange/wiki/Xdispec)
23-
is maintained as a GitHub wiki
22+
* The [metadata dictionary](specification/dictionary.md), version 1.0.
2423

25-
The
26-
[metadata dictionary](https://github.com/XraySpectroscopy/XAS-Data-Interchange/wiki/Dictionary-of-metadata)
27-
is also a GitHub wiki
28-
29-
Please note that the LaTeX version of the specification is out-of-date
30-
with respect to the version on the wiki. The LaTeX will be brought
31-
up-to-date when the final version 1.0 specification is agreed upon by
32-
those involved.
33-
34-
The specification is also provided as
35-
[a grammer file](https://github.com/bruceravel/XAS-Data-Interchange/blob/master/grammar).
36-
In that file, the file specification is defined as an augmeted
37-
Backus-Naur Form (BNF) grammer. This grammer can be used by any
38-
aBNF-aware tool to parse the contents of an XDI-compliant file. This,
39-
too, may be out of date until the 1.0 specification is released.
4024

4125

4226
Implementations
@@ -78,9 +62,11 @@ Other files
7862
validate as XDI
7963
* The `doc/` folder contains the LaTeX source of the poster on XDI
8064
presented at the XAFS15 conference
81-
* The `magic` file can be appended to `/etc/magic` or otherwise used
82-
by the Unix file determination system:
65+
* The `filemagic` folder contains tools for use by the Unix file
66+
determination system:
8367

8468
~> file -m magic data/co_metal_rt.xdi
8569
data/co_metal_rt.xdi: XAS Data Interchange file -- XDI specification 1.0
8670

71+
It also defines an icon and a registry entry for XDI files on
72+
Windows.

filemagic/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Tools for using XDI files
2+
=========================
3+
4+
# Unix computers
5+
6+
* `magic`: file type difinition for XDI for the [Unix file type recognition system](http://en.wikipedia.org/wiki/File_%28command%29)
7+
* `install_magic`: Bash shell script for installing the contents of the `magic` file
8+
9+
10+
Install XDI file magic as root:
11+
12+
~> sudo ./install_magic
13+
14+
This assumes that the file `/etc/magic` is used for local magic data.
15+
If the local file magic file is in some other location on your
16+
computer, then
17+
18+
~> sudo ./install_magic /path/to/magic
19+
20+
where `/path/to/magic` is that location on your computer.
21+
22+
Once installed, XDI files can be identified with the [file command](http://en.wikipedia.org/wiki/File_%28command%29):
23+
24+
~> file -m magic data/co_metal_rt.xdi
25+
data/co_metal_rt.xdi: XAS Data Interchange file -- XDI specification 1.0
26+
27+
# Windows computers
28+
29+
Modify the Windows registry to assign an icon to `.xdi` files.
30+
31+
**PLEASE NOTE:**
32+
33+
This works, but is currently an imperfect solution. The
34+
location of the icon is hard wired in the registry file.
35+
Thus, the registry file must currently be edited by hand to
36+
point to the correct location of the icon file.
37+
38+
A script that installed the icon file to a suitable
39+
location, modifies the registry file, then runs the regsitry
40+
edit would be a welcome contribution!
41+
42+
43+
* `xdi.ico`: Windows icon for XDI files
44+
* `xdi.reg`: Windows registry entry for XDI files
45+
46+
Double click on the `xdi.reg` file to modify a computer's registry.
47+
Once this is done, XDI files will be displayed using the XDI icon.
48+
49+
See http://stackoverflow.com/questions/8407066/how-do-i-associate-a-filetype-with-an-icon
50+
and the MSDN link on that page.

filemagic/xdi.reg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Windows Registry Editor Version 5.00
22

33
[HKEY_CLASSES_ROOT\.xdi]
44

5-
[HKEY_CLASSES_ROOT\.tj\DefaultIcon]
6-
@="C:\\path\\to\\xdi.ico"
5+
[HKEY_CLASSES_ROOT\.xdi\DefaultIcon]
6+
@="C:\\Users\\bravel\\Documents\\GitHub\\XAS-Data-Interchange\\filemagic\\xdi.ico,0"

latex/exclamation.jpg

-6.61 KB
Binary file not shown.

latex/xdi.sty

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
%%
2+
%% This file defines the appearence of the XDI specification and the
3+
%% Dictionary of Metadata
4+
%%
5+
\usepackage{bera} % font selection
6+
\usepackage[utf8]{inputenc}
7+
8+
\usepackage{fancybox} % shadow and oval boxes
9+
\usepackage{amsmath, amssymb} % AMS mathematics
10+
\usepackage{graphicx} % figures
11+
12+
\usepackage{color}
13+
\usepackage{fancybox} % shadow and oval boxes
14+
15+
% hyperlinks
16+
\definecolor{purple}{rgb}{.48, .31, .69}
17+
\usepackage[colorlinks=true, linkcolor=blue, urlcolor=purple]{hyperref}
18+
19+
%\usepackage{highlight} % notes to self -- this is highly non-standard
20+
% and should be commented out for
21+
% general use
22+
23+
\usepackage{lineno} %line numbering
24+
25+
\usepackage{alltt} % a verbatim-like environment in which the meaning of slashes and curly braces is unchanged
26+
27+
\usepackage{tocloft} %fine contro,l over the table of contents
28+
\setlength\cftparskip{-1pt}
29+
30+
\usepackage{fullpage}
31+
\setlength{\parindent}{0pt}
32+
\setlength{\parskip}{1.25ex plus2mm minus1mm}
33+
34+
%% typset "XDI" and XDI version number
35+
\newcommand{\sltt}[1]{\textit{\texttt{#1}}}
36+
\newcommand{\xdi}{\sltt{XDI}}
37+
\newcommand{\xdiversion}{1.0}
38+
39+
%% typeset monospace font within a small, gray box
40+
\setlength{\fboxsep}{2pt}
41+
\setlength{\fboxrule}{1pt}
42+
\definecolor{dark-gray}{gray}{0.75}
43+
\definecolor{light-gray}{gray}{0.95}
44+
\newcommand{\xditt}[1]{\fcolorbox{dark-gray}{light-gray}{\small\texttt{#1}}}
45+
46+
47+
%% \newcommand{\mcomm}[2]{\marginpar{\quad\includegraphics[width=1.0cm]{exclamation.jpg}\\%
48+
%% See p.~\pageref{#2}\\\textit{#1}}}
49+
50+
\newenvironment{Boxedminipage}{\begin{Sbox}\begin{minipage}}%
51+
{\end{minipage}\end{Sbox}\shadowbox{\TheSbox}}
52+
53+
\newcommand{\DMD}{\href{https://github.com/XraySpectroscopy/XAS-Data-Interchange/wiki/Dictionary-of-metadata}
54+
{\textsf{Dictionary of Metadata}}}
55+
56+
57+
\newcommand{\Summary}{{\xdi}}
58+
\setlength{\headsep}{2ex}
59+
\usepackage{lastpage}
60+
\usepackage{fancyhdr}
61+
\pagestyle{fancy}
62+
\lhead{}
63+
\chead{}
64+
\rhead{\Summary}
65+
\lfoot{}
66+
\cfoot{}
67+
\rfoot{\thepage \hspace{1pt} / \pageref*{LastPage}}
68+
\renewcommand{\headrulewidth}{2pt}

0 commit comments

Comments
 (0)