• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Fixed MakeDocs created wrong NewLine statements in compiled docs

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,597
Somehow, with the last update, Makedocs faults at creating new lines when compiling docs.

upload_2017-11-10_11-47-25.png


I have to look into this.

The fix is online. See this post:

https://www.cerberus-x.com/communit...ne-statements-in-compiled-docs.230/#post-2042
 
Last edited:
Is this after modifying the help files or just a general rebuild?
I've just cloned the current develop and rebuilt for Windows and all seems Ok.
 
This is with the latest release. Have to look into it when i am back home.
 
Ok, that BUG is in for a while. Somehow the line ending was changed (Linux anyone ? :) ). When I just savea file on my windows system and rebuild it, then the docs are build fine on in thatpart. As we are talking of quite a bit of files, I think MakeDocs need to take care of this automatically.
 
Could be a git CRLF/LF thing or the type of editor used to make changes. There should be a few tools to change them back on the web. Dos2Unix and Unix2Dos should do it.

Edit: May be a standard recommended editor should be mentioned in the docs to use for changes.
 
I think the best way would be for MakeDocs to force LF line endings via simple replace all CRLF to LF and just use LF to separate lines instead of the OS default. This way, if the file had LF endings to begin with, nothing will be changed and will be processed fine. If it had CRLF, all CR's will be removed and docs will be processed fine.

Why replace CRLF to LF and not the vice versa? Simple, if the document had CRLF already, replacing LF with CRLF would create a nast CRCRLF eldritch abomination ;). And we don't want to mess with the Great Old Ones.
 
Still, I think making MakeDocs replace all CRLF endings with LF endings prior to actual processing of the file would be better as developers won't need to care about endings or Github/Git bugs. Why make humans who make mistakes do an extra step (checking for consistent line endings), when you can automate it away?
 
Check out the cross platform Visual Studio Code. It will tell you what the line endings and encoding are in a file.
Yup, the ones that show the problem have a CRLF line ending. It needs to be LF to be used without a problem through MakeDocs. So far I can't find the damn code part were I could fix it during the file reading inside MakeDocs. :confused: But I will keep on pluckin'. One day I will succeed. :rolleyes:
 
Yup, the ones that show the problem have a CRLF line ending.
If it's just a few use Visual Studio code to change the line ending back to CRLF
Look in toker.cxs the Bump method and look for chr=10. You could use a method as part of the condition statement to check for CR(13)LF(10) first to just return the code LF(10).

Edit: This bit of code should be the one
Code:
If chr=10
            _type=Eol
        Else If str="'"
            While Chr() And Chr()<>10
                _pos+=1
            Wend
            If Chr()=10 _pos+=1
            _type=Eol
 
Edit: This bit of code should be the one
I swear/think I tried that. But will do so again.
If it's just a few use Visual Studio code to change the line ending back to CRLF
Sure could do that. But it is better that MakeDocs takes care of that. As we have several people that contribute. And god knows what editor they use and from which platform. And also you have to think about third part docs. The same problem can happen there too.
 
Which operating system is showing problems with line endings?
 
I am on windows and the files are the ones from the itchio distribution.

Does it generate the html files faulty on Linux?
 
Last edited:
Yes seeing this on all three platforms.
 
Ok, even with @dawlanes suggestion, that didn't work. So I went and modified the .gitattributes file on the repository. Checkout everything and now was able to create correct doc files.

Attached is a fixed version. Please replace the content of your docs folder with the stuff inside the zip file.

The online docs are fixed too.
 

Attachments

  • docs_fixed.zip
    594.4 KB · Views: 384
@Martin, when you create a new distribution, make sure you make a full checkout from the repository. This way the file endings are changed.
 
I would add a few other bits in the .gitattributes as well.

# Visual Studio/Windows lf => crlf
*.bat text eol=crlf
*.sln text eof=crlf
*.vcxproj text eof=crlf
*.filters text eof=crlf
*.txt text eof=crlf
*.csproj text eol=crlf
*.ps1 text eol=crlf

# Image files
*.bmp binary
*.png binary
*.jpg binary
*.jpeg binary
*.ico binary
*.icns binary

# Other binrary types
*.pdf binary
*.a binary
*.lib binary

# Compression
*.gz binary
*.zip binary
*.jar binary

And may be
.gitattributes text eol=lf
.gitignore text eol=lf
.gitconfig text eol=lf
 
Back
Top Bottom