reticulatedpines / magiclantern_simplified

A Git based version of Magic Lantern, for those unwilling or unable to work using Mercurial. The vast majority of branches have been removed, with those thought to be important brought in individually and merged.
GNU General Public License v2.0
142 stars 50 forks source link

rst2htlm5 breaks module strings #94

Open ilia3101 opened 1 year ago

ilia3101 commented 1 year ago

How to reproduce

Change this line to this:

rst2htmlCommands = ["rst2html5", "rst2html5.py"]

To simulate someone who only has rst2html5 on their computer.

Now make zip in any platform/camera.

Some modules will have missing module strings errors:

[ CC       ]   dual_iso.o
In file included from dual_iso.c:60:
../../src/module.h:345:10: fatal error: module_strings.h: No such file or directory
  345 | #include "module_strings.h"
      |          ^~~~~~~~~~~~~~~~~~

Overall will fail to build.

Explanation

It becomes clear why this happens if you go to modules/adv_int (or any module with a long README.rst), and run both of these commands:

cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html.py | python2 ../html2text.py -b 700 | sed "s/\r$//"
cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html5.py | python2 ../html2text.py -b 700 | sed "s/\r$//"

Output 1

# Advanced Intervalometer

Advanced ramping and exposure control for the intervalometer

Create keyframes from current camera settings and specify the
frame at which the keyframe is applied. You will select which
parameters you would like to set in the keyframe and which you
would like to ignore. The module ramps (linearly) the vaules of
selected parameters from one keyframe to the next while the
intervalometer is running.

# Usage

You should create an initial keyframe at 1, that has the settings
you are going to start with, that way the module knows what to
ramp from. If you don't do this the module won't ramp to your
first keyframe, it will simply set the values when it gets there (it
doesn't know how to calculate the ramp, b/c it doesn't know what
the values started as).

# Exposure ramping

To ramp basic expo controls (Av, Tv, ISO) set them like normal in
the canon GUI as if you were taking a picture, then go into the
ML menu under 'Shoot' -> 'Intervalometer' -> 'Advanced
Intervalometer' -> 'New Keyframe' and create a new keyframe.
Turn on or off to specify which parameters are to be included in
the keyframe. The current values are displayed on the right for
you, but you cannot change them from here.

# Focus ramping

For Focus you do specify the offset to focus to from the 'New
Keyframe' menu. The module will calculate the number of focus
steps it need to take each frame to arrive at your offset that
you specify. It steps from wherever the lens is focused at the
start. Negative values mean focus closer, positve is towards
infinity. You need to be in LiveView for the focusing to work and
make sure there is enough time after the exposure is taken,
before the next one starts for the focusing to take place (I
recommend at least 2s, maybe more depending on camera and
lens)

# Misc notes

You can ramp the intervalometer period as well, this you also
specify from within the new keyframe menu

Once you have created keyframes you can view them with the
'List Keyframes' menu. You can also save your keyframe
sequence to file, and then reload them later. If not saved, any
keyframes you created will be lost when the camera is turned
off. Keyframes are saved and loaded from a file called "SEQ.TXT"
in the ML/SETTINGS directory.

When you have created keyframes and are ready to begin, make
sure the advanced intervalometer is turned on, then turn the
intervalometer on as usual from the ML Shoot menu.

# AutoETTR compatibility

This module is compatible with AutoETTR so long as you don't try
to ramp the parameters that AutoETTR is trying to change. You
can ramp Av and let AutoETTR take care of Tv and ISO, or you
can ramp Av and Tv and let AuttoETTR only set ISO, or put
AutoETTR to link to Canon shutter (then your Tv will basically be
setting the slowest Tv parameter of AutoETTR)

Output 2

# Advanced Intervalometer

Advanced ramping and exposure control for the intervalometer

Create keyframes from current camera settings and specify the
frame at which the keyframe is applied. You will select which
parameters you would like to set in the keyframe and which you
would like to ignore. The module ramps (linearly) the vaules of
selected parameters from one keyframe to the next while the
intervalometer is running.

## Usage

You should create an initial keyframe at 1, that has the settings
you are going to start with, that way the module knows what to
ramp from. If you don't do this the module won't ramp to your
first keyframe, it will simply set the values when it gets there (it
doesn't know how to calculate the ramp, b/c it doesn't know what
the values started as).

## Exposure ramping

To ramp basic expo controls (Av, Tv, ISO) set them like normal in
the canon GUI as if you were taking a picture, then go into the
ML menu under 'Shoot' -> 'Intervalometer' -> 'Advanced
Intervalometer' -> 'New Keyframe' and create a new keyframe.
Turn on or off to specify which parameters are to be included in
the keyframe. The current values are displayed on the right for
you, but you cannot change them from here.

## Focus ramping

For Focus you do specify the offset to focus to from the 'New
Keyframe' menu. The module will calculate the number of focus
steps it need to take each frame to arrive at your offset that
you specify. It steps from wherever the lens is focused at the
start. Negative values mean focus closer, positve is towards
infinity. You need to be in LiveView for the focusing to work and
make sure there is enough time after the exposure is taken,
before the next one starts for the focusing to take place (I
recommend at least 2s, maybe more depending on camera and
lens)

## Misc notes

You can ramp the intervalometer period as well, this you also
specify from within the new keyframe menu

Once you have created keyframes you can view them with the
'List Keyframes' menu. You can also save your keyframe
sequence to file, and then reload them later. If not saved, any
keyframes you created will be lost when the camera is turned
off. Keyframes are saved and loaded from a file called "SEQ.TXT"
in the ML/SETTINGS directory.

When you have created keyframes and are ready to begin, make
sure the advanced intervalometer is turned on, then turn the
intervalometer on as usual from the ML Shoot menu.

## AutoETTR compatibility

This module is compatible with AutoETTR so long as you don't try
to ramp the parameters that AutoETTR is trying to change. You
can ramp Av and let AutoETTR take care of Tv and ISO, or you
can ramp Av and Tv and let AuttoETTR only set ISO, or put
AutoETTR to link to Canon shutter (then your Tv will basically be
setting the slowest Tv parameter of AutoETTR)

rst2html5 produces different html header tags, causing html2text.py to produce different markdown header tags (two # instead of one)

ilia3101 commented 1 year ago

Checks for rst2html5 were added due to this mac user not having rst2html 6 years ago.

I'd suggest removing them.

Installing docutils on mac with pip gave me both rst2html.py and rst2html5.py.

Plus it was 6 years ago, things have almost certainly changed - macs don't come with python2 anymore, everything is modernised in this respect.