It's because -D parameter is to override some of builtin config options like language or html_theme. It can't introduce new value.
As Takeshi pointed out, for these purposes are tags (-t parameter) good for. Libor Dne pá 22. 11. 2019 14:54 uživatel Andy Cheesman <[email protected]> napsal: > Hi everyone, > > I would like to pass a custom variable to the conf.py so I can apply some > logic rules within the conf. > (this is a simple example, I know I can do this with other option but i > can expand this to do more beyond the scope of the question) > > if branch_name == "master": > todo_include_todos = False > else: > todo_include_todos = True > tags.add("internal") > > However, when I try to build, it fails with the error below. > The -D option (-D branch_name=develop) results in the same issue. > > NameError: name 'branch_name' is not defined. > > If I define the variable in the conf, there is no error but it isn't > overwritten by the -D command > > Anyone got any suggestions what I should do? > > Thanks > > Andy > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sphinx-users/1ffb4ae7-073b-4632-b7d3-5ee802f62960%40googlegroups.com > <https://groups.google.com/d/msgid/sphinx-users/1ffb4ae7-073b-4632-b7d3-5ee802f62960%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAB-x1GJwxFCoZ6KMOgbc7oSkEkoxu8jhzy0OcGGPXS-RahvxGg%40mail.gmail.com.
