Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial version of miss_hit #741

Merged
merged 9 commits into from
Dec 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update m2md.m
Co-authored-by: Jorge Pérez Zerpa <[email protected]>
  • Loading branch information
mvanzulli and jorgepz authored Dec 20, 2024
commit 61c4f338ec97f1208ee35130bf7f14d2cb454ad2
2 changes: 1 addition & 1 deletion docs/src/m2md.m
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
function m2md(fileIn, fileOut, includeCodeBoolean, iniLine)

fidIn = fopen(fileIn, 'r');
fidOut = fopen(fileOut, 'w');

Check warning on line 4 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L3-L4

Added lines #L3 - L4 were not covered by tests

for i = 1:iniLine
currentLine = fgetl(fidIn);

Check warning on line 7 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L6-L7

Added lines #L6 - L7 were not covered by tests
end

isInCodeBlock = ~(length(currentLine) >= 3 && strcmp(currentLine(1:3), '% md'));
lineCount = 0;

Check warning on line 11 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L10-L11

Added lines #L10 - L11 were not covered by tests

while ~feof(fidIn)

Check warning on line 13 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L13

Added line #L13 was not covered by tests

lineCount = lineCount + 1;
if lineCount ~= 1
currentLine = fgetl(fidIn);

Check warning on line 17 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L15-L17

Added lines #L15 - L17 were not covered by tests
end

if length(currentLine) >= 7 && strcmp(currentLine((end - 6):end), '% hidden')

Check warning on line 20 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L20

Added line #L20 was not covered by tests
% hidden line do not do anything

elseif length(currentLine) >= 3 && strcmp(currentLine(1:3), '% md') % not code
elseif length(currentLine) >= 4 && strcmp(currentLine(1:4), '% md') % not code

if isInCodeBlock % closes code block before writing comment
if includeCodeBoolean
fprintf(fidOut, '```\n');

Check warning on line 27 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L25-L27

Added lines #L25 - L27 were not covered by tests
end
isInCodeBlock = false;

Check warning on line 29 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L29

Added line #L29 was not covered by tests
end
fprintf(fidOut, '%s\n', currentLine(4:end));

Check warning on line 31 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L31

Added line #L31 was not covered by tests

else
if ~isInCodeBlock % open code block
if includeCodeBoolean
fprintf(fidOut, '```\n');

Check warning on line 36 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L34-L36

Added lines #L34 - L36 were not covered by tests
end
isInCodeBlock = true;

Check warning on line 38 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L38

Added line #L38 was not covered by tests
end
if includeCodeBoolean
fprintf(fidOut, '%s\n', currentLine);

Check warning on line 41 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L41

Added line #L41 was not covered by tests
end
end
end

fclose(fidIn);
fclose(fidOut);

Check warning on line 47 in docs/src/m2md.m

View check run for this annotation

Codecov / codecov/patch

docs/src/m2md.m#L46-L47

Added lines #L46 - L47 were not covered by tests
Loading